0

I have one object which is returning values in Datetime object. This attribute in mentioned in jar file so I am not able to join. When I got value I want to DateTime value into ZonedDateTime.

I searched on google but I didn't got any specific answers.

So any one can help me to solve this issue ?

Code : DateTime datetime = reader.getValueAsDateTime();

I want store into ZonedDateTime.

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
vijayk
  • 2,533
  • 10
  • 33
  • 56

1 Answers1

1

You can use something like this:

ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(datetime.getMillis()), ZoneId.systemDefault());

where ZoneId.systemDefault() is system default timezone. You can change it as per your requirement.

vskjk
  • 37
  • 7