Re: Bug in DateString with TimeZone?
- To: mathgroup at smc.vnet.net
- Subject: [mg93463] Re: Bug in DateString with TimeZone?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sun, 9 Nov 2008 05:26:22 -0500 (EST)
On 11/8/08 at 3:59 AM, ncc1701zzz at gmail.com (Nacho) wrote: >I'm trying to get the time in format HHMM in Timezone GMT and I'm >having problems, TimeZone works weird. >I don't know if it is a bug. My Timezone is GMT+1, and I get: >In[25]:= DateString[{"Hour", "", "Minute"}] Out[25]= "2122" (It's >OK) >In[26]:= DateString[TimeZone -> 0] Out[26]= "Fri 7 Nov 2008 >20:22:17" (It's OK) >In[27]:= DateString[{"Hour", "", "Minute"}, TimeZone -> 0] Out[27]= >"2222" (Wrong! this is GMT+2) >I solved my problem using: >In[28]:= DateString[AbsoluteTime[TimeZone -> 0], {"Hour", "", >"Minute"}] Out[28]= "2022" >but I think there is a problem with TimeZone... I don't think the problem should be attributed to TimeZone but should be attributed to DateString. It does look like a bug. It appears the value of $TimeZone is being added in one case when it should be subtracted. In my case I get In[7]:= $TimeZone Out[7]= -8. In[8]:= DateString[{"Hour", "", "Minute"}] Out[8]= 0914 In[9]:= DateString[TimeZone :> 0] Out[9]= Sat 8 Nov 2008 17:14:26 In[10]:= DateString[{"Hour", "", "Minute"}, TimeZone :> 0] Out[10]= 0114 In[11]:= $Version Out[11]= 6.0 for Mac OS X PowerPC (32-bit) (May 21, 2008)