You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Derek B. Greer" <dg...@fedex.com> on 2004/05/12 20:52:53 UTC

Re: timezone working?

I never saw a response to this, so I'm posting this again.  Perhaps I 
don't understand timezone offsets
correctly.  Does the GMT offset differ depending on whether you are on 
daylight savings time or not?

Derek

Derek B. Greer wrote:

> So how do I specify CDT, or how do I specify to account for daylight 
> savings time?
> Derek
>
>
> Webb Morris wrote:
>
>> -6 = CST, right now you are on CDT (Daylight Saving Time).
>>
>> WM
>>
>>
>> --- "Derek B. Greer" <dg...@fedex.com> wrote:
>>  
>>
>>> Is the maven time zone working properly?  I've put in my time zone 
>>> offset which is -6, but
>>> the "Time" shows one hour ahead.
>>>
>>> Derek
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>   
>>
>>
>>
>>
>>     
>>        
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
>> http://photos.yahoo.com/ph/print_splash
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>>  
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: timezone working?

Posted by Tim Reilly <ti...@consultant.com>.
I may have missed the context for this?
Do you want the last build date to show the correct timestamp regardless of
time zone?

This _should_ work with maven.xdoc.date.format=dd MMM yyyy HH:mm:ss z
(The js works as in the examples below, I didn't test/modify my jsl though)

Such as..

 <j:if test="${date == 'navigation-bottom'}">
   <div id="lastPublished">Last published:
+     <script lang="javscript">
+       document.write(new Date(Date.parse(${build.date})).toLocaleString())
+     </script>
   </div>
 </j:if>



+--------------------------+
Examples to drop in browser:
+--------------------------+
gmtTimeMs = 1084577575203;
alert((new Date(gmtTimeMs).toLocaleString()));

gmtTimeMs = Date.parse("14 May 2004 19:32:55 EST")
alert((new Date(gmtTimeMs).toLocaleString()));

gmtTimeMs = Date.parse("14 May 2004 19:32:55 EDT")
alert((new Date(gmtTimeMs).toLocaleString()));
+--------------------------+

Hope it helps (sorry if I missed the point)
-TR


> -----Original Message-----
> From: Webb Morris [mailto:webbmorris@yahoo.com]
> Sent: Wednesday, May 12, 2004 3:07 PM
> To: Maven Users List
> Subject: Re: timezone working?
>
>
> Sorry, I forgot about it after a while.  I did take a look at the
> code for generating the time.
> Basically, since the code is JavaScript running in the browser,
> it takes the current system time
> according to the browser, adjusts it to GMT, and then adds the
> offset hours.  I tried to figure
> out how to fix the problem of "knowing" about a particular time
> zone being in Daylight Saving
> mode, but I believe that is impossible with JavaScript tools.
>
> Since the offset is really just that, an offset value, and that
> value is variable throughout the
> year (at least in the US), then your only option is to change the
> value the same time that you
> change the clocks, or deal with the difference.  Perhaps you
> could write a plugin that would
> dynamically determine your offset at generation time.  All it
> would need to do is determine if you
> were currently in Daylight Saving mode and then adjust the offset
> accordingly.  Of course, this
> means that you would have to make sure to rebuild your project
> site at the same time that the
> clock changes, so that probably isn't of much use.
>
> Maybe someone else has some better insight into the problem.
>
> WM
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: timezone working?

Posted by Webb Morris <we...@yahoo.com>.
Sorry, I forgot about it after a while.  I did take a look at the code for generating the time. 
Basically, since the code is JavaScript running in the browser, it takes the current system time
according to the browser, adjusts it to GMT, and then adds the offset hours.  I tried to figure
out how to fix the problem of "knowing" about a particular time zone being in Daylight Saving
mode, but I believe that is impossible with JavaScript tools.

Since the offset is really just that, an offset value, and that value is variable throughout the
year (at least in the US), then your only option is to change the value the same time that you
change the clocks, or deal with the difference.  Perhaps you could write a plugin that would
dynamically determine your offset at generation time.  All it would need to do is determine if you
were currently in Daylight Saving mode and then adjust the offset accordingly.  Of course, this
means that you would have to make sure to rebuild your project site at the same time that the
clock changes, so that probably isn't of much use.

Maybe someone else has some better insight into the problem.

WM


--- "Derek B. Greer" <dg...@fedex.com> wrote:
> I never saw a response to this, so I'm posting this again.  Perhaps I 
> don't understand timezone offsets
> correctly.  Does the GMT offset differ depending on whether you are on 
> daylight savings time or not?
> 
> Derek
> 
> Derek B. Greer wrote:
> 
> > So how do I specify CDT, or how do I specify to account for daylight 
> > savings time?
> > Derek
> >
> >
> > Webb Morris wrote:
> >
> >> -6 = CST, right now you are on CDT (Daylight Saving Time).
> >>
> >> WM
> >>
> >>
> >> --- "Derek B. Greer" <dg...@fedex.com> wrote:
> >>  
> >>
> >>> Is the maven time zone working properly?  I've put in my time zone 
> >>> offset which is -6, but
> >>> the "Time" shows one hour ahead.
> >>>
> >>> Derek
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>   
> >>
> >>
> >>
> >>
> >>     
> >>        
> >> __________________________________
> >> Do you Yahoo!?
> >> Yahoo! Photos: High-quality 4x6 digital prints for 25�
> >> http://photos.yahoo.com/ph/print_splash
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >>  
> >>
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org