Hi Folks,
I am trying to make a scripted field that takes the "@timestamp" field converts it to PST (pacific standard time) and then extracts the hour.
Can anyone see where I am going wrong with the below scripted field?
String datetime = doc['@timestamp'].value;
ZonedDateTime utc = ZonedDateTime.parse(datetime);
ZonedDateTime pst = utc.withZoneSameInstant(ZoneId.of('America/Los_Angeles'));
return pst.getHour();