Things noticed when testing timezones

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Things noticed when testing timezones

Sundeep

Hi All,

 

We are using Joda as our date-time and timezone api. We found a few interesting things during testing and wanted to open up a discussion on the same.

 

1)      Timezone for Australia(Australia/Sydney) does not show EDT when the daylightsaving is ON ,it always shows only EST but the offset shown is current during Daylightsaving.  

 

Shown in UI for Daylight time : (EST/ UTC+11:00) {The offset is right}

 

Shown in UI for a date without Daylight time : (EST/ UTC+10:00)

 

 

            String userSelecteddate = "10/10/2011";  (Date during day light for Australia)

            String userSelectedTime = "09:00 AM";

            Pattern pat1 = Pattern.compile("(0[1-9]|1[012]|[1-9])[- /.](0[1-9]|[12][0-9]|3[01]|[1-9])[- /.]\\d\\d\\d\\d");

            Matcher mat = pat1.matcher(userSelecteddate);

            if (mat.find()){

          DateTimeFormatter formatter = DateTimeFormat.forPattern("MM/dd/yyyy hh:mm a");

        DateTime date = formatter.withZone(DateTimeZone.forID("Australia/Sydney")).parseDateTime(userSelecteddate + " " + userSelectedTime);

        DateTimeFormatter dtf1 = DateTimeFormat.forPattern("ZZ");

        DateTimeFormatter dtf2 = DateTimeFormat.forPattern("z");

        System.out.println( "(" + date.toString(dtf2) + "/ UTC" + date.toString(dtf1) + ")");

 

 

 

2)      The time zone displayed for 1:00 AM and 1:30 AM is not the same for US and UK thought the time daylight savings ends at 2:00 AM for both, either both should show day light time or both should show standard time for 1:00 AM and 1:30 AM.


For US:
For US on the first Sunday of Nov at 2:00 AM the day light savings ends and the clock is changed to 1:00 AM standard time.
In the application at 1:00 AM and 1:30 AM the time zone displayed is referring to Daylight time (CDT)
>From 2:00 AM the time zone reflects Standard time (CST)


For Brazil:
For Brazil on Sunday Feb 20th 12:00 PM the daylight savings ends and the clock is moved back 1 hr to 11:00 PM (sat)reflect standard time that is BRT
In the application for sat 19th feb 11:00 and 11:30 PM reflect Daylight time of BRST from 12:00 AM it shows standard time of BRT


For UK:
For UK on the last Sunday of Oct at 2:00 AM the day light savings ends and the clock is changed to 1:00 AM standard time.
In the application for 1:00 AM and 1:30 AM the time zone shows GMT.(standard time)

For Australia:
For Australia on Sunday April 03 at 3:00 AM the clock is turned back 1 hr to Standard time EST.
In the Application for 2:00 AM and 2:30 AM the time zone shows EST with the right offset.

 

 

Please let us know your thoughts.

 

 

Thanks

Sundeep

 


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Things noticed when testing timezones

Adam Vartanian
> 1)      Timezone for Australia(Australia/Sydney) does not show EDT when the
> daylightsaving is ON ,it always shows only EST but the offset shown is
> current during Daylightsaving.

This is correct; like many places in the world, Australia refers to
their non-standard time as "summer time".  Thus, they have Eastern
Standard Time and Eastern Summer Time, which both have EST as their
abbreviation.

> 2)      The time zone displayed for 1:00 AM and 1:30 AM is not the same for
> US and UK thought the time daylight savings ends at 2:00 AM for both, either
> both should show day light time or both should show standard time for 1:00
> AM and 1:30 AM.

Can you be specific about what timestamps you're referring to, or how
you're creating your objects that you're referring to?  Both 1:00 AM
and 1:30 AM exist twice on the days that daylight savings time ends,
so if you're creating these data objects inconsistently, you might see
one time zone or another.

- Adam

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Things noticed when testing timezones

jodastephen
In reply to this post by Sundeep
On 6 September 2011 10:58, Raghavachary, Sundeep
<[hidden email]> wrote:
> 1)      Timezone for Australia(Australia/Sydney) does not show EDT when the
> daylightsaving is ON ,it always shows only EST but the offset shown is
> current during Daylightsaving.

This is correct. The (Olson) TZ database specifies "EST" for both
http://comments.gmane.org/gmane.comp.time.tz/3347

> 2)      The time zone displayed for 1:00 AM and 1:30 AM is not the same for
> US and UK thought the time daylight savings ends at 2:00 AM for both, either
> both should show day light time or both should show standard time for 1:00
> AM and 1:30 AM.

I suspect that you are using Joda-Time v1.x rather than v2.0, which is
more consistent.

Stephen

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Loading...