Offset Value

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

Offset Value

Guido Gonni
Hello everybody!
I have a problem which is puzzling me.
Let' s say I have a localTime of DateTime type. Now I convert it with the method toDateTime or withZone to another Time Zone.
I want to determine what the offset between the two Time Zones is (e.g. if localTime Zone is New York and convertedTime Zone is Rome I should get 6).
I've tried to determine the Period between the two Objects, but, since the result of the conversion maintains the same milliseconds value of the  first one, the result is "PT0S".
Can anybody help me with this?
Thank you guys for your attention!
Have a great day.
                           Guido

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
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: Offset Value

jodastephen
The (delayed) answer to this question is to use Duration.between(a, b)
Stephen

On 5 June 2014 11:38, Guido Gonni <[hidden email]> wrote:

> Hello everybody!
> I have a problem which is puzzling me.
> Let' s say I have a localTime of DateTime type. Now I convert it with the
> method toDateTime or withZone to another Time Zone.
> I want to determine what the offset between the two Time Zones is (e.g. if
> localTime Zone is New York and convertedTime Zone is Rome I should get 6).
> I've tried to determine the Period between the two Objects, but, since the
> result of the conversion maintains the same milliseconds value of the  first
> one, the result is "PT0S".
> Can anybody help me with this?
> Thank you guys for your attention!
> Have a great day.
>                            Guido
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> Joda-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Loading...