Re: getting current DateTime

2015-01-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 02, 2015 08:31:11 Steven Schveighoffer via Digitalmars-d-learn wrote: > On 1/2/15 6:21 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > > The main places that code is likely to use DateTime is if it needs to > > operate on dates and times separately from any connection to

Re: getting current DateTime

2015-01-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/2/15 6:21 AM, Jonathan M Davis via Digitalmars-d-learn wrote: The main places that code is likely to use DateTime is if it needs to operate on dates and times separately from any connection to the system's time or time zones and when you want to get the separate pieces of the date and time

Re: getting current DateTime

2015-01-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, December 31, 2014 19:07:13 bitwise via Digitalmars-d-learn wrote: > > Why do you need DateTime and not SysTime? > > > > I'm actually surprised it doesn't have that too... > > > > -Steve > > Initially I was looking for something that would be the > equivalent to DateTime in C#. This no

Re: getting current DateTime

2014-12-31 Thread bitwise via Digitalmars-d-learn
Why do you need DateTime and not SysTime? I'm actually surprised it doesn't have that too... -Steve Initially I was looking for something that would be the equivalent to DateTime in C#. This now appears to be SysTime, not DateTime in D. It seems the only real reason to use DateTime is as a

Re: getting current DateTime

2014-12-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/31/14 1:41 AM, bitwise wrote: It would be nice if that cast was made implicit though. Just realizing now that DateTime doesn't have sub-second accuracy =/ Why do you need DateTime and not SysTime? I'm actually surprised it doesn't have that too... -Steve

Re: getting current DateTime

2014-12-30 Thread bitwise via Digitalmars-d-learn
It would be nice if that cast was made implicit though. Just realizing now that DateTime doesn't have sub-second accuracy =/

Re: getting current DateTime

2014-12-30 Thread bitwise via Digitalmars-d-learn
On Wednesday, 31 December 2014 at 06:31:13 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 31 Dec 2014 06:03:04 + bitwise via Digitalmars-d-learn wrote: How do you get the current DateTime? Why doesn't DateTime have DateTime.now? but it has! ;-) auto now = cast(DateTime)Clock.currTi

Re: getting current DateTime

2014-12-30 Thread ketmar via Digitalmars-d-learn
On Wed, 31 Dec 2014 06:03:04 + bitwise via Digitalmars-d-learn wrote: > How do you get the current DateTime? > Why doesn't DateTime have DateTime.now? but it has! ;-) auto now = cast(DateTime)Clock.currTime; signature.asc Description: PGP signature

Re: getting current DateTime

2014-12-30 Thread FrankLike via Digitalmars-d-learn
On Wednesday, 31 December 2014 at 06:03:06 UTC, bitwise wrote: How do you get the current DateTime? Why doesn't DateTime have DateTime.now? import std.stdio; import std.datetime; void main() { writeln(Clock.currTime); } Frank

getting current DateTime

2014-12-30 Thread bitwise via Digitalmars-d-learn
How do you get the current DateTime? Why doesn't DateTime have DateTime.now?