www.digitalmars.com         C & C++   DMDScript  

D - problem with std.date

reply Ant <duitoolkit yahoo.ca> writes:
If I do date from the command  prompt:
$ date
Tue Mar 16 10:19:51 EST 2004

If I do it from D:
date = Sat Jan 17 03:39:50 GMT-0500 1970

Is anybody using std.date at all?
(or std.zip?)

Ant

import std.date;

void main()
{
	printf("date = %.*s\n", std.date.toString(getUTCtime()));
}
	
	
Mar 16 2004
next sibling parent "Matthew" <matthew stlsoft.org> writes:
Am currently interested in both of these. For the moment I've been hacking
Win32 date functions in D, and spawning WinZips cmd-line tool, as am pressed
for time.

I'd be interested in hearing of any serious exercising of the std.date
stuff.



"Ant" <duitoolkit yahoo.ca> wrote in message
news:pan.2004.03.16.15.23.49.369090 yahoo.ca...
 If I do date from the command  prompt:
 $ date
 Tue Mar 16 10:19:51 EST 2004

 If I do it from D:
 date = Sat Jan 17 03:39:50 GMT-0500 1970

 Is anybody using std.date at all?
 (or std.zip?)

 Ant

 import std.date;

 void main()
 {
 printf("date = %.*s\n", std.date.toString(getUTCtime()));
 }
Mar 16 2004
prev sibling next sibling parent =?ISO-8859-1?Q?Julio_Jim=E9nez?= <jujibo inicia.es> writes:
Ant wrote:
 If I do date from the command  prompt:
 $ date
 Tue Mar 16 10:19:51 EST 2004
 
 If I do it from D:
 date = Sat Jan 17 03:39:50 GMT-0500 1970
 
 Is anybody using std.date at all?
 (or std.zip?)
 
 Ant

 import std.date;
 
 void main()
 {
 	printf("date = %.*s\n", std.date.toString(getUTCtime()));
 }
 	
 	
I watch that problem when trying to set date and time to files in zip.... :) weird!
Mar 16 2004
prev sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Ant wrote:
 If I do date from the command  prompt:
 $ date
 Tue Mar 16 10:19:51 EST 2004
 
 If I do it from D:
 date = Sat Jan 17 03:39:50 GMT-0500 1970
 
 Is anybody using std.date at all?
 (or std.zip?)
 
 Ant

 import std.date;
 
 void main()
 {
 	printf("date = %.*s\n", std.date.toString(getUTCtime()));
 }
The "version (Win32)" section seems ok. Your example seems to work fine on my computer (WindowsXP). echo off date /t time /t dmd std_date.d std_date.exe pause Tue 03/16/2004 09:43 PM d:\dmd\bin\..\..\dm\bin\link.exe std_date,,,user32+kernel32/noi; date = Tue Mar 16 21:43:30 GMT-0600 2004 -- Justin http://jcc_7.tripod.com/d/
Mar 16 2004
next sibling parent reply "Phill" <phill pacific.net.au> writes:
I cut and pasted the code into my  current
project and it works fine and prints:

date = Wed Mar 17 19:39:21 GMT+1000 2004

(WinXP)

Phill.

"J C Calvarese" <jcc7 cox.net> wrote in message
news:c38htn$11j$1 digitaldaemon.com...
 Ant wrote:
 If I do date from the command  prompt:
 $ date
 Tue Mar 16 10:19:51 EST 2004

 If I do it from D:
 date = Sat Jan 17 03:39:50 GMT-0500 1970

 Is anybody using std.date at all?
 (or std.zip?)

 Ant

 import std.date;

 void main()
 {
 printf("date = %.*s\n", std.date.toString(getUTCtime()));
 }
The "version (Win32)" section seems ok. Your example seems to work fine on my computer (WindowsXP). echo off date /t time /t dmd std_date.d std_date.exe pause Tue 03/16/2004 09:43 PM d:\dmd\bin\..\..\dm\bin\link.exe std_date,,,user32+kernel32/noi; date = Tue Mar 16 21:43:30 GMT-0600 2004 -- Justin http://jcc_7.tripod.com/d/
Mar 17 2004
parent "Phill" <phill pacific.net.au> writes:
Hang on thats one hour behind, hmmmnnnnnnn

It should have said

20:39:21

Its not reading the daylight savings time, no doubt.

Phill.


"Phill" <phill pacific.net.au> wrote in message
news:c396h6$13f5$1 digitaldaemon.com...
 I cut and pasted the code into my  current
 project and it works fine and prints:

 date = Wed Mar 17 19:39:21 GMT+1000 2004

 (WinXP)

 Phill.

 "J C Calvarese" <jcc7 cox.net> wrote in message
 news:c38htn$11j$1 digitaldaemon.com...
 Ant wrote:
 If I do date from the command  prompt:
 $ date
 Tue Mar 16 10:19:51 EST 2004

 If I do it from D:
 date = Sat Jan 17 03:39:50 GMT-0500 1970

 Is anybody using std.date at all?
 (or std.zip?)

 Ant

 import std.date;

 void main()
 {
 printf("date = %.*s\n", std.date.toString(getUTCtime()));
 }
The "version (Win32)" section seems ok. Your example seems to work fine on my computer (WindowsXP). echo off date /t time /t dmd std_date.d std_date.exe pause Tue 03/16/2004 09:43 PM d:\dmd\bin\..\..\dm\bin\link.exe std_date,,,user32+kernel32/noi; date = Tue Mar 16 21:43:30 GMT-0600 2004 -- Justin http://jcc_7.tripod.com/d/
Mar 17 2004
prev sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"J C Calvarese" <jcc7 cox.net> wrote in message
news:c38htn$11j$1 digitaldaemon.com
| The "version (Win32)" section seems ok. Your example seems to work fine
| on my computer (WindowsXP).
|
|  echo off
| date /t
| time /t
| dmd std_date.d
| std_date.exe
| pause
|
| Tue 03/16/2004
| 09:43 PM
| d:\dmd\bin\..\..\dm\bin\link.exe std_date,,,user32+kernel32/noi;
| date = Tue Mar 16 21:43:30 GMT-0600 2004
|
| --
| Justin
| http://jcc_7.tripod.com/d/

It's a problem with DMD for Linux. I reported it months ago. But there're
problems with Windows too, as Phill said. Try to run the same program but
setting your timezone to South America Pacific (Bogotá, Quito, Lima: GMT-5,
but not in the US): it'll fail.

-----------------------
Carlos Santander Bernal
Mar 17 2004
parent reply J C Calvarese <jcc7 cox.net> writes:
Carlos Santander B. wrote:

 "J C Calvarese" <jcc7 cox.net> wrote in message
 news:c38htn$11j$1 digitaldaemon.com
 | The "version (Win32)" section seems ok. Your example seems to work fine
 | on my computer (WindowsXP).
 |
 |  echo off
 | date /t
 | time /t
 | dmd std_date.d
 | std_date.exe
 | pause
 |
 | Tue 03/16/2004
 | 09:43 PM
 | d:\dmd\bin\..\..\dm\bin\link.exe std_date,,,user32+kernel32/noi;
 | date = Tue Mar 16 21:43:30 GMT-0600 2004
 |
 | --
 | Justin
 | http://jcc_7.tripod.com/d/
 
 It's a problem with DMD for Linux. I reported it months ago. But there're
 problems with Windows too, as Phill said. Try to run the same program but
 setting your timezone to South America Pacific (Bogotá, Quito, Lima: GMT-5,
 but not in the US): it'll fail.
You're right. It doesn't work then. Wed 03/17/2004 09:14 PM d:\dmd\bin\..\..\dm\bin\link.exe std_date,,,user32+kernel32/noi; date = Thu Mar 18 02:14:21 GMT+0000 2004
 
 -----------------------
 Carlos Santander Bernal
-- Justin http://jcc_7.tripod.com/d/
Mar 17 2004
parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"J C Calvarese" <jcc7 cox.net> wrote in message
news:c3b0q6$18mq$1 digitaldaemon.com
|
| You're right. It doesn't work then.
|
| Wed 03/17/2004
| 09:14 PM
| d:\dmd\bin\..\..\dm\bin\link.exe std_date,,,user32+kernel32/noi;
| date = Thu Mar 18 02:14:21 GMT+0000 2004
|
| --
| Justin
| http://jcc_7.tripod.com/d/

One more thing: IIRC, Y. Tomino found the source of the bug somewhere in the
DMD code, or in Phobos, I can't remember that well. Anyway, Walter should
know how to solve it. With Linux, however, I think it's a different story.

-----------------------
Carlos Santander Bernal
Mar 17 2004
parent reply "Walter" <walter digitalmars.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:c3b29o$1b4j$1 digitaldaemon.com...
 One more thing: IIRC, Y. Tomino found the source of the bug somewhere in
the
 DMD code, or in Phobos, I can't remember that well.
Hmm, I missed that. Do you remember the message?
Mar 22 2004
next sibling parent Carlos Santander B. <Carlos_member pathlink.com> writes:
In article <c3nd2t$kju$1 digitaldaemon.com>, Walter says...
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:c3b29o$1b4j$1 digitaldaemon.com...
 One more thing: IIRC, Y. Tomino found the source of the bug somewhere in
the
 DMD code, or in Phobos, I can't remember that well.
Hmm, I missed that. Do you remember the message?
It's in this thread: http://www.digitalmars.com/drn-bin/wwwnews?D/20448 The diagnostic was by k.inaba: http://www.digitalmars.com/drn-bin/wwwnews?D/20470 And you said you had it fixed: http://www.digitalmars.com/drn-bin/wwwnews?D/26151 I think there was another thread about it. I'll keep looking. ------------------- Carlos Santander B.
Mar 22 2004
prev sibling parent Carlos Santander B. <Carlos_member pathlink.com> writes:
In article <c3nd2t$kju$1 digitaldaemon.com>, Walter says...
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:c3b29o$1b4j$1 digitaldaemon.com...
 One more thing: IIRC, Y. Tomino found the source of the bug somewhere in
the
 DMD code, or in Phobos, I can't remember that well.
Hmm, I missed that. Do you remember the message?
Seems like you already did... :D. Sorry, I hadn't noticed about that other post. ------------------- Carlos Santander B.
Mar 22 2004