jodatime - Joda-time How to get current standard time, not system time - Stack Overflow
The question is slightly ambiguous, but to get the current time you can simply use:
new DateTime();
This will give you the DateTime in the default Chronology (calendaring system) and the system TimeZone. However, if you want to create a DateTime object that is represented in a different or "standard time" zone to you. You can use:
new DateTime(DateTimeZone.UTC);
Or you can use DateTimeZone to construct a different time zone that you are interested in. For a more detailed explanation see: DateTimeZone API Document
Read full article from jodatime - Joda-time How to get current standard time, not system time - Stack Overflow
No comments:
Post a Comment