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
  • 100,966
  • 191
  • 140
  • 197
vijayk
  • 2,633
  • 14
  • 38
  • 59

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
  • 55
  • 8