d_time and writefln

Chris Nicholson-Sauls ibisbasenji at gmail.com
Mon May 8 22:42:44 PDT 2006


Carlos Santander wrote:
> d_time should be recognized by writefln.
> 
> //-------------
> import std.date;
> import std.stdio;
> 
> void main() {
>     d_time fecha = getUTCtime();
>     writefln("%s",toDateString(fecha));
>     writefln(fecha);
> }
> //-------------
> 
> Outputs (any system):
> 
> $ ./test
> Tue May 09 2006
> 1147138947602
> 

The problem is, that 'd_time' is just an alias of long, so writef*() just sees it as a 
long.  Maybe d_time could be typedef'd to change this, but would that break anything?  If 
it has no or few cons against it, I'm cool with typedef'ing it, although it would couple 
std.format and std.date to each other a little.

-- Chris Nicholson-Sauls



More information about the Digitalmars-d-bugs mailing list