On Sunday, March 8, 2020 11:19:33 PM MDT tchaloupka via Digitalmars-d-learn
wrote:
> On Sunday, 8 March 2020 at 17:28:33 UTC, Robert M. Münch wrote:
> > On 2020-03-07 12:10:27 +, Jonathan M Davis said:
> >
> > DateTime dt =
> > DateTime.fromISOExtString(split("2018-11-06T16:52:03+01:00",
> >
On Sunday, 8 March 2020 at 17:28:33 UTC, Robert M. Münch wrote:
On 2020-03-07 12:10:27 +, Jonathan M Davis said:
DateTime dt =
DateTime.fromISOExtString(split("2018-11-06T16:52:03+01:00",
regex("\\+"))[0]);
IMO such a string should be feedable directly to the function.
You just need
g should be feedable directly to the function.
It took me less than an hour to figure out how to provide a local
version of std.datetime named local.datetime:
```local/datetime.d
module local.datetime;
public import std.datetime;
struct DateTime {
std.datetime.DateTime dt;
alias dt this
On 2020-03-07 12:10:27 +, Jonathan M Davis said:
I take it that you're asking why you don't get the time zone as part of the
string when you call one of the to*String functions?
The problem is, the from* functions give an error, that this is not an
ISO date.
I get this in an XML
On Saturday, March 7, 2020 2:43:47 AM MST Robert M. Münch via Digitalmars-d-
learn wrote:
> It looks like std.datetime is not anticipating the +1:00 part of a date
> like: "2018-11-06T16:52:03+01:00"
>
> Those dates are used all over on the internet and I'mm wondering why
>
It looks like std.datetime is not anticipating the +1:00 part of a date
like: "2018-11-06T16:52:03+01:00"
Those dates are used all over on the internet and I'mm wondering why
it's not supported. Any reason? Is this +01:00 not ISO conforming?
--
Robert M. Münch
http://www.sap
y project no longer
> >> build:
> >>
> >> zero.lib(core_cde_4a4f.obj) : error LNK2001: unresolved
> >> external symbol _D3std8d
> >> atetime9LocalTime6opCallFNaNbNeZyC3std8datetime9LocalTime
> >>
> >> and many more. All about std.
atetime9LocalTime6opCallFNaNbNeZyC3std8datetime9LocalTime
and many more. All about std.datetime.
Then it sounds like you need to make sure that you rebuild your
project and all of its dependencies (which you should be doing
with any compiler upgrade anyway, since they're not ABI
compatible). Your
atetime9LocalTime6opCallFNaNbNeZyC3std8datetime9LocalTime
and many more. All about std.datetime.
Then it sounds like you need to make sure that you rebuild your
project and all of its dependencies (which you should be doing
with any compiler upgrade anyway, since they're not ABI
compatible). Your
atetime9LocalTime6opCallFNaNbNeZyC3std8datetime9LocalTime
and many more. All about std.datetime.
Then it sounds like you need to make sure that you rebuild your
project and all of its dependencies (which you should be doing
with any compiler upgrade anyway, since they're not ABI
compatible). Your
me
>
> and many more. All about std.datetime.
Then it sounds like you need to make sure that you rebuild your project and
all of its dependencies (which you should be doing with any compiler upgrade
anyway, since they're not ABI compatible). Your code should work just fine
with std.datetim
https://dlang.org/changelog/2.075.0.html#split-std-datetime
After upgrade dmd to latest 2.075.0, my project no longer build:
zero.lib(core_cde_4a4f.obj) : error LNK2001: unresolved external
symbol _D3std8d
atetime9LocalTime6opCallFNaNbNeZyC3std8datetime9LocalTime
and many more. All about std.datetime.
On Sat, 2017-05-13 at 02:23 -0700, Jonathan M Davis via Digitalmars-d-
learn wrote:
>
[…]
> At best, it's slang. It's not proper anything.
>
> https://github.com/dlang/phobos/pull/5388
>
> - Jonathan M Davis
Indeed. Thanks for getting a pull request in to ameliorate the
difficulty.
--
On Saturday, May 13, 2017 06:53:25 Russel Winder via Digitalmars-d-learn
wrote:
> Is there a canonical, idiomatic way of processing std.datetime objects
> using std.getopt?
>
> Currently, I am suffering:
>
> /usr/include/d/std/getopt.d(921): Error: static assert "Dunno
On Sat, 2017-05-13 at 06:05 +, Vladimir Panteleev via Digitalmars-
d-learn wrote:
> On Saturday, 13 May 2017 at 05:53:25 UTC, Russel Winder wrote:
> > Is there a canonical, idiomatic way of processing std.datetime
> > objects using std.getopt?
>
> As std.getopt is goin
On Saturday, 13 May 2017 at 05:53:25 UTC, Russel Winder wrote:
Is there a canonical, idiomatic way of processing std.datetime
objects using std.getopt?
As std.getopt is going to give you strings, you need to convert
strings to SysTime values, e.g. using fromSimpleString:
import std.datetime
Is there a canonical, idiomatic way of processing std.datetime objects
using std.getopt?
Currently, I am suffering:
/usr/include/d/std/getopt.d(921): Error: static assert "Dunno how to deal with
type SysTime*"
which on the one hand is understandable, albeit dreadful English,
error - years should start from 1, not 0.
But if months or days start from 0 std.datetime throws exception and
don't for years - it isn't clear that zero year is negative one (in
that
mean that stdTime for '' years will be negative.
As the documentation states in multiple places, std.datetime
> >> But if months or days start from 0 std.datetime throws exception and
> >> don't for years - it isn't clear that zero year is negative one (in
> >> that
> >> mean that stdTime for '' years will be negative.
> >
> > As the documentation states
10.02.2017 18:02, Jonathan M Davis via Digitalmars-d-learn пишет:
On Friday, February 10, 2017 14:35:28 drug via Digitalmars-d-learn wrote:
I found error - years should start from 1, not 0.
But if months or days start from 0 std.datetime throws exception and
don't for years - it isn't clear
On Friday, February 10, 2017 14:35:28 drug via Digitalmars-d-learn wrote:
> I found error - years should start from 1, not 0.
> But if months or days start from 0 std.datetime throws exception and
> don't for years - it isn't clear that zero year is negative one (in that
> mean
10.02.2017 14:15, drug пишет:
unittest
{
import std.datetime : SysTime, UTC;
{
auto st = SysTime();
st.timezone(UTC());
long date = st.fromISOExtString("2017-02-10T00:00:00Z").stdTime,
time_of_day =
st.fromISOExtString("-
unittest
{
import std.datetime : SysTime, UTC;
{
auto st = SysTime();
st.timezone(UTC());
long date =
st.fromISOExtString("2017-02-10T00:00:00Z").stdTime,
time_of_day =
st.fromISOExtString(&quo
a SysTime from the string.
auto currentTime = Clock.currTime();
auto timeString = currentTime.toISOExtString();
auto restoredTime = SysTime.fromISOExtString(timeString);
This is what I use:
auto getDateTimeString() {
import std.string;
import std.datetime
On Thursday, 30 June 2016 at 21:18:22 UTC, Luke Picardo wrote:
Why is it so hard to simply get the current date and time
formatted properly in a string?
There are no examples of this in your documentation yet this is
probably one of the most used cases.
To get the current time, use
On Monday, 24 October 2011 at 15:29:41 UTC, Jonathan M Davis
wrote:
On Friday, October 07, 2011 19:58:12 Joel Christensen wrote:
> http://d-programming-language.org/intro-to-datetime.html
Thanks Jonathan, that helped I think, (haven't read it all,
though). But I've got errors with some of the
On 02.04.2015 09:19, Jonathan M Davis via Digitalmars-d-learn wrote:
On Tuesday, March 31, 2015 12:47:34 anonymous via Digitalmars-d-learn wrote:
On Tuesday, 31 March 2015 at 11:51:26 UTC, drug wrote:
import std.datetime;
import std.stdio;
void main
On Tuesday, March 31, 2015 12:47:34 anonymous via Digitalmars-d-learn wrote:
On Tuesday, 31 March 2015 at 11:51:26 UTC, drug wrote:
import std.datetime;
import std.stdio;
void main()
{
long.max.SysTime.toISOExtString.writeln;
}
dmd 2.065 (dpaste.dzfl.pl):
+29228-09-14T02
On Tuesday, 31 March 2015 at 11:51:26 UTC, drug wrote:
import std.datetime;
import std.stdio;
void main()
{
long.max.SysTime.toISOExtString.writeln;
}
dmd 2.065 (dpaste.dzfl.pl):
+29228-09-14T02:48:05.4775807
dmd v2.067-devel-c6b489b (using Digger):
-29227-04-20T00:11:54.5224191
import std.datetime;
import std.stdio;
void main()
{
long.max.SysTime.toISOExtString.writeln;
}
dmd 2.065 (dpaste.dzfl.pl):
+29228-09-14T02:48:05.4775807
dmd v2.067-devel-c6b489b (using Digger):
-29227-04-20T00:11:54.5224191
could somebody confirm it?
On Thursday, 17 January 2013 at 07:17:57 UTC, Jonathan M Davis
wrote:
I'd still like to break it up a bit, but I'm not going to do it
unless some
variant of DIP15 or DIP16 is implemented so that it can be done
without
breaking any code. So, it probably won't be broken up any time
soon. It's
Hello, I'm kinda ashamed to ask that here, but std.datetime
documentation is so complex... I only want to get hour/minute from a
t_time (no timezone).
I'm moving to D2, the equivalent code in D1 was:
std.date.Date date;
date.parse(std.date.toUTCString(time));
date.hour;
Nevermind, found it myself.
SysTime* sys = new SysTime(standardTime, UTC());
sys.hour;
Le 16/01/2013 08:07, n00b a écrit :
Hello, I'm kinda ashamed to ask that here, but std.datetime
documentation is so complex... I only want to get hour/minute from a
t_time (no timezone).
I'm moving to D2
On Wednesday, January 16, 2013 09:15:39 n00b wrote:
Nevermind, found it myself.
SysTime* sys = new SysTime(standardTime, UTC());
sys.hour;
Le 16/01/2013 08:07, n00b a écrit :
Hello, I'm kinda ashamed to ask that here, but std.datetime
documentation is so complex... I only want to get
Le 16/01/2013 10:54, Jonathan M Davis a écrit :
On Wednesday, January 16, 2013 09:15:39 n00b wrote:
Nevermind, found it myself.
SysTime* sys = new SysTime(standardTime, UTC());
sys.hour;
Le 16/01/2013 08:07, n00b a écrit :
Hello, I'm kinda ashamed to ask that here, but std.datetime
On Wednesday, 16 January 2013 at 14:15:46 UTC, n00b wrote:
Nevermind, found it myself.
SysTime* sys = new SysTime(standardTime, UTC());
sys.hour;
Le 16/01/2013 08:07, n00b a écrit :
Hello, I'm kinda ashamed to ask that here, but std.datetime
documentation is so complex... I only want to get
On Wednesday, 16 January 2013 at 13:07:48 UTC, n00b wrote:
Hello, I'm kinda ashamed to ask that here, but std.datetime
documentation is so complex...
You'll likely have a much easier time reading this.
http://vibed.org/temp/d-programming-language.org/phobos/std/datetime.html
Those pages
On Thursday, January 17, 2013 07:15:14 Rob T wrote:
On Wednesday, 16 January 2013 at 13:07:48 UTC, n00b wrote:
Hello, I'm kinda ashamed to ask that here, but std.datetime
documentation is so complex...
You'll likely have a much easier time reading this.
http://vibed.org/temp/d
On Thursday, 17 January 2013 at 06:26:21 UTC, Jonathan M Davis
wrote:
On Thursday, January 17, 2013 07:15:14 Rob T wrote:
On Wednesday, 16 January 2013 at 13:07:48 UTC, n00b wrote:
Hello, I'm kinda ashamed to ask that here, but std.datetime
documentation is so complex...
You'll likely have
On Thursday, January 17, 2013 07:57:51 Rob T wrote:
Yeah, I was amazed at how much simpler things became after better
formatting and organization was applied. Beforehand people were
asking for std.datetime to be broken up, but no need anymore,
although maybe the part on benchmarking
TimeOfDay's roll function refers to an add method which would
increment or decrement the next greater unit of time when it
wraps a unit of time. This method seems to be absent, while
DateTime has it.
Actually I see DateTime's method is days and months only, why
aren't hours, minutes and seconds available?
On 09/20/2012 09:02 AM, ixid wrote:
TimeOfDay's roll function refers to an add method
I see how The difference between rolling and adding ... implies that
there is also an add() function just like there is a roll() function. In
fact, adding is handled simply by operator overloading. You can
On Thursday, September 20, 2012 18:02:04 ixid wrote:
TimeOfDay's roll function refers to an add method which would
increment or decrement the next greater unit of time when it
wraps a unit of time. This method seems to be absent, while
DateTime has it.
Create a Duration and use +. e.g.
auto
repeated-letter format specifiers
similar to those found in some other schemes, and designed to be logical, natural-looking,
extensible and easy to remember.
It doesn't currently have functions to convert between its types and those in
std.datetime, but it's straightforward to construct
Is there a way to format std.datetime.Date objects with a custom format
string? In particular, I'd like to reuse month short names defined in
std.datetime, but it appears that the names are private. I'd really
rather not duplicate them by hand, if there's a way to get them.
Alternatively
On Friday, April 20, 2012 13:29:34 H. S. Teoh wrote:
Is there a way to format std.datetime.Date objects with a custom format
string? In particular, I'd like to reuse month short names defined in
std.datetime, but it appears that the names are private. I'd really
rather not duplicate them
On Friday, October 07, 2011 19:58:12 Joel Christensen wrote:
http://d-programming-language.org/intro-to-datetime.html
Thanks Jonathan, that helped I think, (haven't read it all, though). But
I've got errors with some of the date times not being able to change
them with int's values.
Hi,
I have a program that uses the old time stuff before the module
std.datetime. I have a DateTime object, but I can't seem to set its
properties to the current time.
Some thing like:
DateTime dateTime;
dateTime = getCurrentDateTime();
-JoelCNZ
On Friday, October 07, 2011 19:08:33 Joel Christensen wrote:
Hi,
I have a program that uses the old time stuff before the module
std.datetime. I have a DateTime object, but I can't seem to set its
properties to the current time.
Some thing like:
DateTime dateTime;
dateTime
On 2011-10-07 08:15, Jonathan M Davis wrote:
On Friday, October 07, 2011 19:08:33 Joel Christensen wrote:
Hi,
I have a program that uses the old time stuff before the module
std.datetime. I have a DateTime object, but I can't seem to set its
properties to the current time.
Some thing like
On Friday, October 07, 2011 08:23:10 Jacob Carlborg wrote:
On 2011-10-07 08:15, Jonathan M Davis wrote:
On Friday, October 07, 2011 19:08:33 Joel Christensen wrote:
Hi,
I have a program that uses the old time stuff before the module
std.datetime. I have a DateTime object, but I can't
before the module
std.datetime. I have a DateTime object, but I can't seem to set
its
properties to the current time.
Some thing like:
DateTime dateTime;
dateTime = getCurrentDateTime();
http://d-programming-language.org/intro-to-datetime.html
May I suggest that you put
http://d-programming-language.org/intro-to-datetime.html
Thanks Jonathan, that helped I think, (haven't read it all, though). But
I've got errors with some of the date times not being able to change
them with int's values.
task.d(44): Error: function std.datetime.DateTime.month () const is
a program that uses the old time stuff before the module
std.datetime. I have a DateTime object, but I can't seem to set
its
properties to the current time.
Some thing like:
DateTime dateTime;
dateTime = getCurrentDateTime();
http://d-programming-language.org/intro-to-datetime.html
May I suggest
Steve Teale Wrote:
Alternatively, let me explain my desire. When my program first runs, I want to
hazard a guess as to what size of paper the user is likely to use - US Letter
Size, or A4/inches or metric.
Do you wanna say all pdfs from america are done in letter size and won't print
right
Steve Teale Wrote:
Anyway, how would you do it?
You need a compatibility layer like http://en.wikipedia.org/wiki/Freedesktop.org
They already can have solution or you can consult with them.
and so
on would be SOL.
Anyway, how would you do it?
Determining the exact time zone that the computer is in is really hard. It's
actually pretty easy to do in Windows, but on Posix... not so much. So,
there's no function in std.datetime to do it. If I can ever figure out how to
sanely do
Oh, so it is difficult after all! I thought it was just me.
So I am probably going to have to ask. Then the interesting question will be
which
way around will offend fewest people.
I have installed it as ISO, then have to ask US users if they would prefer
Letter
Size, or the other way round
. Though
hopefully std.datetime manages to make most of it fairly easy and pleasant to
deal with.
So I am probably going to have to ask. Then the interesting question will be
which way around will offend fewest people.
I have installed it as ISO, then have to ask US users if they would prefer
On 09/15/2011 07:48 PM, Steve Teale wrote:
Alternatively, let me explain my desire. When my program first runs, I want to
hazard a guess as to what size of paper the user is likely to use - US Letter
Size, or A4/inches or metric. GTK does not seem to want to tell me about the
default printer
Recall that std.date used the following to retrieve a month in integer form (0
.. 11):
auto Now = std.date.getUTCtime();
writeln(std.date.monthFromTime(Now));
Using std.datetime, the following yields the abbreviated month name:
auto Now = Clock.currTime();
writefln(%s, Now.month
This material is really great, but why isn't
it directly associated with the std.datetime package somewhere? My
second reaction was Jonathan should not have had to write such a long
email in reply, he should have been able to say 'Please go read URL'
for an explanation.
Jonathan, Please can you
documentation page?
My reaction was very much This material is really great, but why isn't
it directly associated with the std.datetime package somewhere? My
second reaction was Jonathan should not have had to write such a long
email in reply, he should have been able to say 'Please go read
On Sun, 2011-05-08 at 23:52 -0700, Jonathan M Davis wrote:
[ . . . ]
I could look at writing an article on moving from std.date to std.datetime, I
suppose. We already have an article contest going, and it would make sense to
put such an article on the site.
I suspect many people would
On Mon, 09 May 2011 09:49:04 +0100, Russel Winder wrote:
On Sun, 2011-05-08 at 23:52 -0700, Jonathan M Davis wrote: [ . . . ]
I could look at writing an article on moving from std.date to
std.datetime, I suppose. We already have an article contest going, and
it would make sense to put
. Use std.datetime instead.
More: wiki link to migration guide
When something is renamed, just listing the new name is enough since
that's everything you need to know. But a whole new module needs
a brain shift and a link can do that better than a one line message.
While it looks like everything
Jonathan M Davis jmdavisp...@gmx.com wrote in message
news:mailman.80.1304923988.14074.digitalmars-d-le...@puremagic.com...
I could look at writing an article on moving from std.date to
std.datetime, I
suppose. We already have an article contest going, and it would make sense
to
put
I decided to update my compiler today, and regret it for a lot of
reasons, but meh.
One of the things is std.datetime. A lot of my code uses std.date. It
works very, very well for me and I like it.
But, the compile process is nagging me about it. I want it to shut up.
However, I'm not even
On 2011-05-08 17:46, Adam D. Ruppe wrote:
I decided to update my compiler today, and regret it for a lot of
reasons, but meh.
One of the things is std.datetime. A lot of my code uses std.date. It
works very, very well for me and I like it.
But, the compile process is nagging me about
I would point out though that'll be a while before std.date and its related
functions actually go away, so any code which needs to be converted to
std.datetime definitely has time to be reworked however is appropriate.
Currently, they're scheduled for deprecation, which just results
Jonathan M Davis wrote:
I would point out though that'll be a while before std.date and its
related functions actually go away, so any code which needs to be
converted to std.datetime definitely has time to be reworked
however is appropriate.
Yeah, but I figure it's better to do it sooner
On 2011-05-08 21:29, Adam D. Ruppe wrote:
Jonathan M Davis wrote:
I would point out though that'll be a while before std.date and its
related functions actually go away, so any code which needs to be
converted to std.datetime definitely has time to be reworked
however is appropriate
Jonathan M Davis jmdavisp...@gmx.com wrote in message
news:mailman.74.1304905547.14074.digitalmars-d-le...@puremagic.com...
On 2011-05-08 17:46, Adam D. Ruppe wrote:
I decided to update my compiler today, and regret it for a lot of
reasons, but meh.
One of the things is std.datetime. A lot
I am trying to get the number of seconds from 1970 using the
std.datetime module.
long val = SysTime(Date(1996, 1, 1)).toUnixTime()
Shouldnt the above statement give me a Timezone independent result i.e.
'toUnixTime'.
Also, is there a method to get seconds directly from Date and DateTime
I am trying to get the number of seconds from 1970 using the
std.datetime module.
long val = SysTime(Date(1996, 1, 1)).toUnixTime()
Shouldnt the above statement give me a Timezone independent result i.e.
'toUnixTime'.
unix time is _always_ in UTC by definition.
You're creating a SysTime
Hello,
I'm in the process of learning D, and to do so I'm converting some older code.
I need to print out the current local date and time, which is causing
some difficulties because std.date doesn't seem adequate in this
respect. I understand there is soon to be a replacement, std.datetime
in this
respect. I understand there is soon to be a replacement, std.datetime,
which I suspect will be much easier.
When are we likely to see a new release which includes std.datetime?
If not relatively soon I presume the easiest thing to do is to download
it myself and recompile the phobos library
Hi Jonathan,
I'm also stuck with the existing std.date and would want to try out your new
module std.datetime. Do you have any sense when the next release of Phobos is
going to be?
If not, what is the procedure to get a development snapshot of the latest
version of Phobos installed?
thanks
On Tuesday 18 January 2011 04:15:20 %fil wrote:
Hi Jonathan,
I'm also stuck with the existing std.date and would want to try out your
new module std.datetime. Do you have any sense when the next release of
Phobos is going to be?
I don't know. The last release was about a month ago
On 2011-01-18 16:34:53 +, Jonathan M Davis said:
On Tuesday 18 January 2011 04:15:20 %fil wrote:
Hi Jonathan,
I'm also stuck with the existing std.date and would want to try out your
new module std.datetime. Do you have any sense when the next release of
Phobos is going to be?
I don't
On Tue, 2011-01-18 at 08:34 -0800, Jonathan M Davis wrote:
[ . . . ]
I don't know. The last release was about a month ago, and the one before that
was about a month and a half before that. I'm not aware of there being any
hard
and fast rules or plan about when releases are done. However,
On Tuesday, January 18, 2011 09:18:33 Russel Winder wrote:
On Tue, 2011-01-18 at 08:34 -0800, Jonathan M Davis wrote:
[ . . . ]
I don't know. The last release was about a month ago, and the one before
that was about a month and a half before that. I'm not aware of there
being any hard
there is soon to be a replacement, std.datetime,
which I suspect will be much easier.
When are we likely to see a new release which includes std.datetime?
If not relatively soon I presume the easiest thing to do is to download
it myself and recompile the phobos library to include it. In which case
85 matches
Mail list logo