www.digitalmars.com         C & C++   DMDScript  

D - bug: std.date.toDateString()? std.date.getUTCtime()?

reply "Carlos Santander B." <carlos8294 msn.com> writes:
This code:

import std.c.stdio, std.date;
void main() {
    char [] fecha= toDateString(getUTCtime());
    printf("%.*s\n",fecha);
}

Produces this output: "Error: Switch Default date(609)". Am I missing
something? (dmd 0.76 for win)

-----------------------
Carlos Santander Bernal


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 2003-12-15
Dec 16 2003
next sibling parent reply "Walter" <walter digitalmars.com> writes:
It works fine when I try it ...
Dec 16 2003
next sibling parent reply k.inaba <k.inaba_member pathlink.com> writes:
According to MSDN,
http://msdn.microsoft.com/library/en-us/sysinfo/ base/gettimezoneinformation.asp
GetTimeZoneInformation() API returns TIME_ZONE_ID_UNKNOWN if daylight saving
time is not used in the current time zone. Maybe this case should not be treated
as an error...

Kaz.
Dec 17 2003
parent "Walter" <walter digitalmars.com> writes:
"k.inaba" <k.inaba_member pathlink.com> wrote in message
news:brpca9$1ql3$1 digitaldaemon.com...
 According to MSDN,
 http://msdn.microsoft.com/library/en-us/sysinfo/
base/gettimezoneinformation.asp
 GetTimeZoneInformation() API returns TIME_ZONE_ID_UNKNOWN if daylight
saving
 time is not used in the current time zone. Maybe this case should not be
treated
 as an error...
I think you're right. Fixed. -Walter
Mar 22 2004
prev sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"Walter" <walter digitalmars.com> wrote in message
news:brot1l$13g5$1 digitaldaemon.com...
| It works fine when I try it ...
|
|

Can somebody else confirm this?

-----------------------
Carlos Santander Bernal


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 2003-12-15
Dec 17 2003
parent reply "Andrew Edwards" <edwardsac spamfreeusa.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:brr3nh$1brv$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:brot1l$13g5$1 digitaldaemon.com...
 | It works fine when I try it ...
 |
 |

 Can somebody else confirm this?
Works for me! (WinXP) However, changing the TimeZone wield the following error for Osaka Japan, West Central Africa, Monrovia, and many others: Error: Switch Default date(609) Andrew
Dec 17 2003
parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"Andrew Edwards" <edwardsac spamfreeusa.com> wrote in message
news:brr4i3$1d2r$1 digitaldaemon.com...
| Works for me! (WinXP)
|
| However, changing the TimeZone wield the following error for Osaka Japan,
| West Central Africa, Monrovia, and many others:
|
| Error: Switch Default date(609)
|
| Andrew
|
|

I have it under Bogotá, Quito, Lima (GMT-5). Maybe that's the reason.

-----------------------
Carlos Santander Bernal


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 2003-12-15
Dec 17 2003
parent reply "Andrew Edwards" <edwardsac spamfreeusa.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:brr4o7$1d8r$1 digitaldaemon.com...
 "Andrew Edwards" <edwardsac spamfreeusa.com> wrote in message
 news:brr4i3$1d2r$1 digitaldaemon.com...
 | Works for me! (WinXP)
 |
 | However, changing the TimeZone wield the following error for Osaka
Japan,
 | West Central Africa, Monrovia, and many others:
 |
 | Error: Switch Default date(609)
 |
 | Andrew
 |
 |

 I have it under Bogotá, Quito, Lima (GMT-5). Maybe that's the reason.

 -----------------------
 Carlos Santander Bernal
Results in previous error! Try NewYork and see the result!
Dec 17 2003
next sibling parent "Andrew Edwards" <edwardsac spamfreeusa.com> writes:
"Andrew Edwards" <edwardsac spamfreeusa.com> wrote in

 Results in previous error! Try NewYork and see the result!
Sorry, I meant Eastern Time (GMT-5) right below Bogota.
Dec 17 2003
prev sibling parent "Carlos Santander B." <carlos8294 msn.com> writes:
"Andrew Edwards" <edwardsac spamfreeusa.com> wrote in message
news:brr582$1e4e$1 digitaldaemon.com...
| Results in previous error! Try NewYork and see the result!
|
|

Yes, NY works, but I want to have my comp properly configured ;). Oddly,
Indiana doesn't work either (Indiana is more appropiate for me: there's no
day light saving hour). Anyway, it's obviously a bug.

-----------------------
Carlos Santander Bernal


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 2003-12-15
Dec 17 2003
prev sibling parent "Carlos Santander B." <carlos8294 msn.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:bro9ca$51u$1 digitaldaemon.com...
| This code:
|
| import std.c.stdio, std.date;
| void main() {
|     char [] fecha= toDateString(getUTCtime());
|     printf("%.*s\n",fecha);
| }
|
| Produces this output: "Error: Switch Default date(609)". Am I missing
| something? (dmd 0.76 for win)
|
| -----------------------
| Carlos Santander Bernal
|

The same, under Linux (dmd 0.76), outputs:

Tue Dec 09 1969

(and this is *so* wrong, because I ran 'date' and I got: mié dic 17 21:22:51
ECT 2003, so something is wrong)

Also, a small suggestion: (when this is fixed) can we have a toString(d_time
time,char [] format) so we can specify the kind of output we want?

-----------------------
Carlos Santander Bernal


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 2003-12-15
Dec 17 2003