views:

45

answers:

2

Is there an equivalent Android class to the BlackBerry's DateTimeUtilities? What I really need is DateTimeUtilities.copyCal(source, dest), and I can write it myself, but I really hate writing functions like this only to find it already exists but I just didn't know. I am aware of clone(), but what I really need is to be able to easily change the timezone of a date without having to worry about DST etc myself.

A: 

Check out Joda Time - Java date and time API

Pentium10
This would definitely work for me, just a little bit more thorough than I need.
MikeR
A: 

AFter some further review and fiddling I think this is the easiest way to address this issue for me:

public static long applyLocalTimezoneOffsetMillis(long timestampUTC)
{
    long offset = TimeZone.getDefault().getOffset(timestampUTC);
    return timestampUTC - offset;
}
MikeR