The date-time you are trying to create does not exist for the time zone
Asia/Delhi because of teh spring DST cutover.
Stephen
Chandrasekhar M wrote:
> Getting an error on running this program.
>
> Any help would be appreciated.
>
>
>
> *public* *class* Test123 {
>
>
>
> *public* Test123() {
>
> // *TODO* Auto-generated constructor stub
>
> }
>
>
>
> /**
>
> * *...@param* args
>
> */
>
> *public* *static* *void* main(String[] args) {
>
> // *TODO* Auto-generated method stub
>
>
>
>
> org.joda.time.DateTimeZone./setDefault/(org.joda.time.DateTimeZone./forID/("Asia/Dubai"));
>
> System./out/.println("
> "+org.joda.time.DateTimeZone./getDefault/());
>
> *int* year= 1920;
>
> *int* month= 1;
>
> *int* day= 1;
>
> *int* hour = 0;
>
> *int* min = 18 ;
>
> *int* sec = 40;
>
> *int* msec = 0;
>
>
>
> org.joda.time.DateTime dt = *new*
> org.joda.time.DateTime(year,month,day,hour,min,sec,msec);
>
> System./out/.println(dt.getChronology().getZone());
>
> System./out/.println(dt.toString());
>
> }
>
> }
>
>
>
> Exception
>
> Asia/Dubai
>
> Exception in thread "main" _java.lang.IllegalArgumentException_: Illegal
> instant due to time zone offset transition: 1919-12-31T20:37:28.000
>
> at
> org.joda.time.chrono.ZonedChronology.localToUTC(_ZonedChronology.java:143_)
>
> at
> org.joda.time.chrono.ZonedChronology.getDateTimeMillis(_ZonedChronology.java:119_)
>
> at
> org.joda.time.chrono.AssembledChronology.getDateTimeMillis(_AssembledChronology.java:133_)
>
> at org.joda.time.base.BaseDateTime.<init>(_BaseDateTime.java:254_)
>
> at org.joda.time.base.BaseDateTime.<init>(_BaseDateTime.java:195_)
>
> at org.joda.time.DateTime.<init>(_DateTime.java:231_)
>
> at com.ehis.util.Test123.main(_Test123.java:25_)
>
>
>
> Regards
>
> Chandra Sekhar M.
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Joda-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
------------------------------------------------------------------------------
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest