i want to get current time (now) from Different time zone .
for example using joda datetime library,
I can get Australian time zone like using JODA datetime
DateTime zoned = new DateTime(DateTimeZone.forID("Australia/Melbourne"));
and its current time Using
DateTime.now(DateTimeZone.forID("Australia/Melbourne"));
if i want to convert this DateTime object into java.sql.Timestamp object
,i have to get its milliseconds using
getMillis method of DateTime class to instantaite new Timestamp Object
Timestamp zonedStamp = new TimeStamp(zoned.getMillis());
so every time the passed milliseconds since the epoch time would be the same logically for each timezone.
My question is how i can get Autralian Time zone's current time to get a zoned Timestamp Object.
Thank You
Mihir Parekh
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…