convert hour of day from local to UTC (taking into account DST)

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

convert hour of day from local to UTC (taking into account DST)

Fabien Coppens
Hi.
I have tasks and schedulers that need to be executed at specific times during
the day in New York time. For example, a certain scheduler needs to be triggered
at 9:30 AM, New York time, regardless of whether the local time zone is
currently EST (=UTC-5) or EDT (=UTC-4).
The server runs on UTC.
How can use the Joda API to convert 9:30 AM America/New_York to the
corresponding UTC time of day ?
Fabien


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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: convert hour of day from local to UTC (taking into account DST)

jodastephen
If you have a DateTime object representing the date, time and time zone,
you can call withZone(DateTimeZone.UTC) to convert the date and time to UTC.

Stephen


Fabien Coppens wrote:

> Hi.
> I have tasks and schedulers that need to be executed at specific times during
> the day in New York time. For example, a certain scheduler needs to be triggered
> at 9:30 AM, New York time, regardless of whether the local time zone is
> currently EST (=UTC-5) or EDT (=UTC-4).
> The server runs on UTC.
> How can use the Joda API to convert 9:30 AM America/New_York to the
> corresponding UTC time of day ?
> Fabien
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Joda-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Loading...