date and time

2010-09-25 Thread Joel Christensen
I'm using D2.049. I have a program in which I want to be able to get the current time as one number, also be able to change the hour and stuff then convert it back to one number. I'm saving just the one number to file. Thanks in advance. :-)

Re: date and time

2010-09-25 Thread Yao G.
On Sat, 25 Sep 2010 18:47:39 -0500, Joel Christensen wrote: I'm using D2.049. I have a program in which I want to be able to get the current time as one number, also be able to change the hour and stuff then convert it back to one number. I'm saving just the one number to file. Thanks

Re: date and time

2010-09-25 Thread Joel Christensen
I've tried that module. I was putting: long dt = UTCtoLocalTime(getUTCtime - (msPerDay / 2)); Then when daylight savings came it was wrong, (computer was right mind). long datetime = UTCtoLocalTime(getUTCtime); It is 1 hour and half a day out. It was the right hour till daylight savings. I live

Re: date and time

2010-09-25 Thread Jonathan M Davis
On Saturday 25 September 2010 17:48:54 Joel Christensen wrote: > I've tried that module. > > I was putting: > long dt = UTCtoLocalTime(getUTCtime - (msPerDay / 2)); > Then when daylight savings came it was wrong, (computer was right mind). > > long datetime = UTCtoLocalTime(getUTCtime); > It is 1

Re: date and time, std.c.stdio

2010-09-25 Thread Joel Christensen
Thanks Jonathan. My plan is to use the C version, and not use the big time_t number. I'm actually using std.c.stdio module too, for binary files, I probably should use std.stream or some thing.

Re: date and time, std.c.stdio

2010-09-25 Thread Jonathan M Davis
On Saturday 25 September 2010 22:40:39 Joel Christensen wrote: > Thanks Jonathan. My plan is to use the C version, and not use the big > time_t number. I'm actually using std.c.stdio module too, for binary > files, I probably should use std.stream or some thing. Well, std.stdio will give you a way

Re: date and time, core access

2010-09-25 Thread Joel Christensen
Thanks for the replies Jonathan M Davis and Yao G. :-) Good to hear it's being worked on. I've other programs that are done with D1.0 that are all right. I'm using Windows, would like it to work on Linux too though. I think I'll use year month etc. separately instead of just having a big num

Re: date and time, core access

2010-09-25 Thread Jonathan M Davis
On Saturday 25 September 2010 21:37:30 Joel Christensen wrote: > Thanks for the replies Jonathan M Davis and Yao G. :-) > > Good to hear it's being worked on. I've other programs that are done > with D1.0 that are all right. > > I'm using Windows, would like it to work on Linux too though. > > I

Get current date and time with std.datetime

2011-10-06 Thread Joel Christensen
Hi, I have a program that uses the old time stuff before the module std.datetime. I have a DateTime object, but I can't seem to set its properties to the current time. Some thing like: DateTime dateTime; dateTime = getCurrentDateTime(); -JoelCNZ

Re: Get current date and time with std.datetime

2016-06-30 Thread Luke Picardo via Digitalmars-d-learn
. So, any function taking a month must take an enum value, not an integer. e.g. Month.jan, Month.feb, Month.mar, etc. If you want to pass it an integral value, you have to cast. e.g. cast(Month)1, cast(Month)2, cast(Month)3, etc. - Jonathan M Davis Why is it so hard to simply get the cur

Re: Get current date and time with std.datetime

2016-07-01 Thread Zekereth via Digitalmars-d-learn
On Thursday, 30 June 2016 at 21:18:22 UTC, Luke Picardo wrote: Why is it so hard to simply get the current date and time formatted properly in a string? There are no examples of this in your documentation yet this is probably one of the most used cases. To get the current time, use

Re: Get current date and time with std.datetime

2016-08-22 Thread Joel via Digitalmars-d-learn
On Friday, 1 July 2016 at 15:28:04 UTC, Zekereth wrote: On Thursday, 30 June 2016 at 21:18:22 UTC, Luke Picardo wrote: Why is it so hard to simply get the current date and time formatted properly in a string? There are no examples of this in your documentation yet this is probably one of

Re: Get current date and time with std.datetime

2011-10-24 Thread Jonathan M Davis
On Friday, October 07, 2011 19:58:12 Joel Christensen wrote: > > http://d-programming-language.org/intro-to-datetime.html > > Thanks Jonathan, that helped I think, (haven't read it all, though). But > I've got errors with some of the date times not being able to change > them with int's values. >

Re: Get current date and time with std.datetime

2011-10-06 Thread Jonathan M Davis
On Friday, October 07, 2011 19:08:33 Joel Christensen wrote: > Hi, > > I have a program that uses the old time stuff before the module > std.datetime. I have a DateTime object, but I can't seem to set its > properties to the current time. > > Some thing like: > DateTime dateTime; > dateTime = get

Re: Get current date and time with std.datetime

2011-10-06 Thread Jacob Carlborg
like: DateTime dateTime; dateTime = getCurrentDateTime(); http://d-programming-language.org/intro-to-datetime.html May I suggest that you put an example on top of that article that gets the current date and time. -- /Jacob Carlborg

Re: Get current date and time with std.datetime

2011-10-06 Thread Jonathan M Davis
uage.org/intro-to-datetime.html > > May I suggest that you put an example on top of that article that gets > the current date and time. It's already in the documentation at the top of the module. What I need to do is put a link to the article in that documetantion. - Jonathan M Davis

Re: Get current date and time with std.datetime

2011-10-06 Thread Jonathan M Davis
like: > > >> DateTime dateTime; > > >> dateTime = getCurrentDateTime(); > > > > > > http://d-programming-language.org/intro-to-datetime.html > > > > May I suggest that you put an example on top of that article that gets > > the current

Re: Get current date and time with std.datetime

2011-10-07 Thread Joel Christensen
http://d-programming-language.org/intro-to-datetime.html Thanks Jonathan, that helped I think, (haven't read it all, though). But I've got errors with some of the date times not being able to change them with int's values. task.d(44): Error: function std.datetime.DateTime.month () const is

Re: Get current date and time with std.datetime

2011-10-07 Thread Jacob Carlborg
that you put an example on top of that article that gets the current date and time. It's already in the documentation at the top of the module. What I need to do is put a link to the article in that documetantion. I just added a link to the article to std.datetime, so it'll be there st