time_t to simple date string conversion

Kai Meyer kai at unixlords.com
Tue Apr 5 15:16:31 PDT 2011


On 04/05/2011 03:59 PM, Jonathan M Davis wrote:
>> I'm reading documentation on std.datetime, and it appears there are
>> added features that I don't have in 2.51 (Linux). Did features like
>> 'SysTime' get added after 2.51?
>>
>> Does anybody have a one-liner to convert a time_t to a date string that
>> should work for me?
>
> std.datetime was completely revamped with 2.52. What existed from in 2.51 has
> little to do with what's in 2.52, and it wasn't even publically documented
> anyway. So, if you're using 2.51, you're still stuck using std.date, which is
> rather broken. I'd definitely recommend that you upgrade to 2.52 if you're
> still using 2.51.
>
> If you're using 2.51 and for some reason can't upgrade, then I'd recommend
> that you just use the standard C functions. That would be less error-prone
> than trying to use std.date, which is scheduled for deprecation anyway.
>
> And assuming that you can't upgrade, if the reason for that is because you're
> installed dmd with your distro, I'd recommend uninstalling it and just
> downloading the zip file from the main site. Your distro is not likely to keep
> dmd as up-to-date as downloading it yourself will, and it improves too quickly
> to stick with a version which is months old. It's easy to use the zip. All you
> have to do is unzip it to wherever you want to unzip it, and the add
> /path/to/unzipped/dmd2/linux/bin to your path, and it works (unless you're on
> a 64-bit box, then you need to install certain 32-bit packages, but it's a
> fairly short list, and if your distro actually includes a package for dmd,
> then it should be easy to figure out what they are by looking at the
> dependencies for that package).
>
> In any case, prior to dmd 2.52, there effectively was no std.datetime. The
> date stuff was the rather buggy std.date, which is now scheduled for
> deprecation. So, either you need to upgrade to 2.52, use std.date, or use the
> standard C functions.
>
> - Jonathan M Davis


So who do I bug to update the RPM build on the Downloads page? The zip 
and windows versions are 2.52, but the Linux RPM version is 2.51.


More information about the Digitalmars-d-learn mailing list