java - ZonedDateTime to UTC with offset applied? -
i using java 8
zoneddatetime looks
2013-07-10t02:52:49+12:00 i value
z1.format(datetimeformatter.iso_offset_date_time) where z1 zoneddatetime.
i wanted convert value 2013-07-10t14:52:49
how can that?
is want? converts zoneddatetime localdatetime given zoneid converting zoneddatetime instant before.
localdatetime localdatetime = localdatetime.ofinstant(z1.toinstant(), zoneid.of("utc")); or maybe want users system-timezone instead of hardcoded utc:
localdatetime localdatetime = localdatetime.ofinstant(z1.toinstant(), zoneid.systemdefault());
Comments
Post a Comment