Parsing strings ignores the timezone string (IST/GMT).
However, it can parse the +01:00/Z.
I'm not sure what parsing will pick in this exact scenario, but you 
could try it with +01:00/Z.

Stephen


Paul Nolan wrote:
> Hi Rodrigo,
> 
> Thanks for the reply.
> 
> I don't think there is anything wrong with it. I am just trying to see 
> if there is a way I can tell it to assume IST and not GMT since there 
> are 2 such times due to DST i.e .
> 
> 1. 2007-10-28 01:20:00 IST and
> 2. 2007-10-28 01:20:00 GMT.
> 
> Is there a way I can do this using the DateTimeFormatter? e.g. is there 
> a way to do the following:
> 
> DateTimeFormatter.parse("2007-10-28 01:20:00 IST") or perhaps
> DateTimeFormatter.parse("2007-10-28 01:20:00 UTC+1")
> 
> or something like that?
> 
> thanks,
> 
> - Paul.
> 
> On 10/24/07, *Rodrigo de Avila * <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     Hi Paul,
> 
>     Sorry, but, nothing wrong to me here:
> 
>     DateTime now = new DateTime(2007, 10, 28, 01, 20, 0, 0,
>     DateTimeZone.forID("Europe/Dublin") );
> 
>     out.println(now + " " + now.getZone()); //2007-10-28T01:20: 00.000Z
>     Europe/Dublin
> 
>     now = now.plusHours(1);
> 
>     out.println(now + " " + now.getZone()); //2007-10-28T02:20:00.000Z
>     Europe/Dublin
> 
>     1) What's the VM default timezone? GMT? If yes, you can change it to
>     Europe/Dublin using  System.setProperty?
> 
>     2) Do you update the TZ information in Joda-time jar file, to
>     recognize the summer time in Europe/Dublin? (I don't know if your ST
>     is fixed or not) Instructions you find in
>     http://joda-time.sourceforge.net/tz_update.html
> 
>     3) Do you see the problem with now.plusHours(1) when you insert this
>     time in an database? If yes, remember: the DateTime class is
>     immutable; when you call new DateTime with parameters, only the fiels
>     are updated (year, month, day, hour, minute, second). The
>     getTimeInMillis is not updated. Use MutableDateTime instead.
> 
> 
>     2007/10/24, Paul Nolan < [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>:
>      > Hi there,
>      >
>      > I live in Ireland. It is currently IST - Irish Summer Time.
>      >
>      > On the 28th October 2007 at 02:00 AM the clocks will go backwards
>     one hour
>      > to 01:00 AM GMT.
>      >
>      > So, in effect, there are two 01:01 AM's, two 01:02 AM's etc. One
>     in IST and
>      > one in GMT.
>      >
>      > My question is this:
>      >
>      > If I execute the code:
>      >
>      >         DateTime now = new DateTime(2007, 10, 28, 01, 20, 0, 0,
>      > DateTimeZone.forID("Europe/Dublin") );
>      >
>      > It defaults to 01:20 GMT. So, naturally if I execute:
>      >
>      >         now = now.plusHours(1);
>      >
>      > The time is now 02:20 GMT.
>      >
>      > How do I tell DateTime to assume IST? I tried with the time zone
>     ID "IST"
>      > but it is not recognised...I know these have been deprecated.
>      >
>      > In other words how do I do something like:
>      >
>      >         DateTime now = new DateTime(2007, 10, 28, 01, 20, 0, 0,
>      > DateTimeZone.forID("IST") );
>      >
>      > To get: 01:20 IST
>      >
>      >         now = now.plusHours(1);
>      >
>      > I get 01:20 GMT?
>      >
>      > thanks,
>      >
>      > - Paul.
>      >
>     -------------------------------------------------------------------------
>      > This SF.net email is sponsored by: Splunk Inc.
>      > Still grepping through log files to find problems?  Stop.
>      > Now Search log events and configuration files using AJAX and a
>     browser.
>      > Download your FREE copy of Splunk now >> http://get.splunk.com/
>      > _______________________________________________
>      > Joda-interest mailing list
>      > [email protected]
>     <mailto:[email protected]>
>      > https://lists.sourceforge.net/lists/listinfo/joda-interest
>      >
>      >
> 
> 
>     --
>     Rodrigo de Avila
>     [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> 
>     http://www.avila.eti.br
> 
>     -------------------------------------------------------------------------
>     This SF.net email is sponsored by: Splunk Inc.
>     Still grepping through log files to find problems?  Stop.
>     Now Search log events and configuration files using AJAX and a browser.
>     Download your FREE copy of Splunk now >> http://get.splunk.com/
>     <http://get.splunk.com/>
>     _______________________________________________
>     Joda-interest mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/joda-interest
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Joda-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/joda-interest

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to