On Thu, Feb 4, 2010 at 5:06 PM, Alexander Klimetschek <[email protected]>wrote:
> On Thu, Feb 4, 2010 at 13:57, xor exor <[email protected]> wrote: > > Well for example i'm getting the date as 2010 12 1 17:00 GMT+2 the time > that > > i get from > > ISO8601.format is OK i mean it is GMT0 15:00 then i try to save that > value > > to db with setProperty the date value is messed to something like GMT+4 > > 19:00 > > Should be obvious: 15:00 GMT+00:00 == 19:00 GMT+04:00 > Of course it is but what i want to do is save time in database as 15:00 GMT+00:00 not as 19:00 GMT+04:00 that is what my method is doing (which source is in my first post). My method is creating a Calendar with GMT0 as timezone and passing it to setProperty method ,but somehow my date is messed and saved differently (with different timezone)to database that is the problem. I hope that is clearer. > > The java.util.Calendar object contains the timezone (to be exact: the > timezone difference, ie. +4 in this case) and this is stored in JCR as > well. So normally just taking a Calendar object in the local timezone > and giving it to JCR works well. > Yeah i know what i want is to save a calendar with GMT0 to database correctly not with local timezone. > > Everything else can be done by using operations on the Calendar object > to convert from and to other timezones. Which is a topic on its own, > that can be answered by Google ;-) > Thanks but i googled it a lot ;) I think the problem is how setProperty handles the dates. Should look at source for more specific info. > > Regards, > Alex > > -- > Alexander Klimetschek > [email protected] >
