Thread overview
std.date / std.datetime
Jan 18, 2011
Jonathan M Davis
Jan 18, 2011
%fil
Jan 18, 2011
Jonathan M Davis
Jan 18, 2011
Russel Winder
Jan 18, 2011
Jonathan M Davis
Jan 18, 2011
torhu
January 18, 2011
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, 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 there seems to be already a std.datetime with different functionality, is this used elsewhere in phobos? i.e. if I replace it with the new std.datetime is that OK?

Many thanks,

Richard

January 18, 2011
On Tuesday 18 January 2011 03:34:06 Richard Chamberlain wrote:
> 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, 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 there seems to be already a std.datetime with different functionality, is this used elsewhere in phobos? i.e. if I replace it with the new std.datetime is that OK?

std.datetime is currently in Phobos' svn repository and will be in the next release.

- Jonathan M Davis
January 18, 2011
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,

fil
January 18, 2011
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, 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, they tend to be a month or two apart.

> If not, what is the procedure to get a "development snapshot" of the latest version of Phobos installed?

The latest code can be found here: http://www.dsource.org/projects/phobos

However, you're going to have to have the latest druntime as well: http://www.dsource.org/projects/druntime

- Jonathan M Davis
January 18, 2011
On 2011-01-18 16:34:53 +0000, 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 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, they tend to be a
> month or two apart.
> 
>> If not, what is the procedure to get a "development snapshot" of the latest
>> version of Phobos installed?
> 
> The latest code can be found here: http://www.dsource.org/projects/phobos
> 
> However, you're going to have to have the latest druntime as well:
> http://www.dsource.org/projects/druntime
> 
> - Jonathan M Davis

Thanks Jonathan.

I think I'll hang around for the official update.

January 18, 2011
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, they tend to be a month or two apart.
[ . . . ]
> The latest code can be found here: http://www.dsource.org/projects/phobos
> 
> However, you're going to have to have the latest druntime as well: http://www.dsource.org/projects/druntime

Might it be worth putting in some infrastructure whereby people can use a distributed DMD or GDC but have a current snapshot or perhaps latest build of Phobos (where there is consistency between DMD/GDC on the one hand and Phobos on the other).  This is actually one thing Go does supremely well, you can pull the Mercurial snapshot and build the entire system within about 5 minutes.  It makes it very easy to test new stuff.

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@russel.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


January 18, 2011
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 and fast rules or plan about when releases are done. However, they tend to be a month or two apart.
> 
> [ . . . ]
> 
> > The latest code can be found here: http://www.dsource.org/projects/phobos
> > 
> > However, you're going to have to have the latest druntime as well: http://www.dsource.org/projects/druntime
> 
> Might it be worth putting in some infrastructure whereby people can use a distributed DMD or GDC but have a current snapshot or perhaps latest build of Phobos (where there is consistency between DMD/GDC on the one hand and Phobos on the other).  This is actually one thing Go does supremely well, you can pull the Mercurial snapshot and build the entire system within about 5 minutes.  It makes it very easy to test new stuff.

There has been discussion of D needing some sort of package management system. Perhaps that would deal with that issue. And maybe with dmd, druntime, and Phobos being moved over to git and github (which is currently being worked on) will make that easier. I don't know. However, I think that the focus of the dev team overall has been more on getting done than making it easier for people to get current development snapshots or know exactly what's going on with development at the moment. That's not to say that such things shouldn't be improved or that the dev team doesn't want to improve them, but there have been other priorities which have taken precedence. There's also a strong tendency for things to get done because someone wants them done and takes the time to do them, and if there's no one who's motivated enough to do something, then it often doesn't get done in a timely manner.

- Jonathan M Davis
January 18, 2011
On 18.01.2011 12:34, Richard Chamberlain wrote:
> 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,
> 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
> there seems to be already a std.datetime with different functionality,
> is this used elsewhere in phobos? i.e. if I replace it with the new
> std.datetime is that OK?

You could always use the C functions, if you import core.stdc.time.  The ctime and strftime functions should do the trick.

http://cplusplus.com/reference/clibrary/ctime/