Hi - 

I am trying work on a simple solution that will return 
complete hours of the day including timezone offset.
Following is the code that is being used to spit 
out each hour: -


DateTimeFormatter fmt = 
DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ssZZ");

//Setting 2011 Fall DST day.
DateTime st = new DateTime(2011, 11, 6, 0, 0, 
              DateTimeZone.forID("America/Chicago"));

DateTime et = new DateTime(2011, 11, 6, 0, 0,
          DateTimeZone.forID("America/Chicago"));
//======================================
for (int i = 0; i <= 24; i++) {
     try {
            if (i > 0) {
                 st = st.minuteOfDay().addToCopy(60);
            }
            et = et.minuteOfDay().addToCopy(60);
      
           System.out.println("START TIME = { "
           + fmt.print(st)
           + " } END TIME =  {" 
           + fmt.print(et) + " }");
     } catch (Exception e) {
        e.printStackTrace();
     }
}
//=====================================

Above logic spit out the all the correct 
(as per our expectation) hours and time offsets
 for all days of the year but the fall DST. For the 
fall DST of 2011, which in Nov 06, we are expecting the
following intervals(hour start -- hour end): -

1st interval
----------------
START TIME = { 2011-11-06T00:00:00-05:00 } 
END TIME =  {2011-11-06T01:00:00-05:00 }

2nd interval
----------------
START TIME = { 2011-11-06T01:00:00-05:00 } 
END TIME =  {2011-11-06T02:00:00-05:00 }

3rd interval
----------------
START TIME = { 2011-11-06T02:00:00-05:00 } 
END TIME =  {2011-11-06T02:00:00-06:00 }

4th interval
----------------
START TIME = { 2011-11-06T02:00:00-06:00 } 
END TIME =  {2011-11-06T03:00:00-06:00 }

But the above code is returning the following result: -

1st interval
----------------
START TIME = { 2011-11-06T00:00:00-05:00 }
END TIME =  {2011-11-06T01:00:00-05:00 }

2nd interval
----------------
START TIME = { 2011-11-06T01:00:00-05:00 } 
END TIME =  {2011-11-06T01:00:00-06:00 }

3rd interval
----------------
START TIME = { 2011-11-06T01:00:00-06:00 }
END TIME =  {2011-11-06T02:00:00-06:00 }


4th interval
----------------
START TIME = { 2011-11-06T02:00:00-06:00 }
END TIME =  {2011-11-06T03:00:00-06:00 }


Our problem is the second and third interval, as per
our expectation, we are expecting the second interval 
as 01:00:00-05:00 to 02:00:00-5:00 and the third 
interval as 02:00:00-5:00 to 02:00:00-6:00, instead of 
the data being returned by the current code. I am 
currently using 2.0RC1 implementation and I did 
try going as far back as 1.5 with slight modifications
in the API the fall DST result is still the same.

Can someone help me on this? I did read somewhere 
that in certain previous version the result would have
 been as we are expecting.Can someone point to that
version or provide details to get what we are expecting?


Best Regards-
Dev


------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to