http://d.puremagic.com/issues/show_bug.cgi?id=1639
s...@iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |s...@iname.com ------- Comment #4 from s...@iname.com 2009-04-30 19:06 ------- (In reply to comment #0) > The Date struct is lacking a day-of-year (Julian day) field. > > Date instances can only be instantiated by parsing a string. Should be > possible to instantiate from clock ticks and explicit date part values. The latter is possible. http://www.digitalmars.com/d/1.0/struct.html#StructLiteral Whether it checks the struct for validity or auto-fills weekday/yday is another matter.... > < if (s < 0 || s > 59) > < throw new Exception("Second value out of range."); This'll prevent storing a leap second time.... > There needs to be a corresponding Time struct for example for use with ODBC. (In reply to comment #2) > >22,25c22,23 > >< private import std.conv; > >< private import std.stdio; > >< private import std.dateparse; > >< private import std.string; > >--- > >> private import std.stdio; > >> private import std.dateparse; > >46,277d43 > >< * Time of day broken down into its components. > >< */ > >< struct Time > >< { > >< int hour; /// 0..23 > >< int minute; /// 0..59 <snip 665 more lines> What was the purpose of copying this long block of code here? But std.date could certainly do with improvements. BTW check out this alternative: http://pr.stewartsplace.org.uk/d/sutil/ --