I want to convert a UTC time to a localisedDateTime or zonedDateTime.
I have the following input: 2013-07-10 02:52:49,-44.490947,171.220966
Where the date time is UTC time zone.
I get my zoneId with latitude and longitude which gives me Pacific/Auckland
.
With this, I try to get the local time at zonePacific/Auckland
from the timestamp and expect as shows the following conversion the result I am looking for.
Playing around with my timeStamp I get:
2013-07-10T02:52:49+12:00[Pacific/Auckland]
.
But I am looking for the following output:
2013-07-10T14:52:49
I don't think that manipulating the string the change it to a number and add manually is the right answer.
I am sure that we can do this with dates but I am new to Java and after surfing for hours I have not yet found my solution.
The solutions below while they seem valid show the date 2013-07-9
and so does it in my code. So if the website shows the time im expecting why are we not getting the same result?