Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Inconsistent behaviour with date/zone

From: pwawood::mango::net::my at: 16-Jan-2005 13:23

The function to-date appears to perform selective validation on the supplied time zone giving a script error :
>> a: to date! "10-11-04 03:00 +00:31"
** Script Error: Invalid argument: 10-11-04 03:00 +00:31 ** Near: a: to date! "10-11-04 03:00 +00:31" Through experimentation I have determined that to-date will on accept 00 or 30 minutes. Yet if you directly "set" the zone of a date, Rebol happily rounds the zone down to either 00 or 30 minutes:
>> b: to-date "10-11-04 03:00"
== 10-Nov-2004/3:00
>> b/zone: 00:31
== 0:31
>> b/zone
== 0:30 I also found that to-date is quite happy to accept strange timezones provided they are a multiple of 30 minutes:
>> e: to-date "10-11-04 03:00 +26:00"
== 10-Nov-2004/3:00+26:00 Regards Peter