I have a timestamp in seconds, e.g. 1543845960
. I need to retrieve a season from this timestamp. How can I do it?
ZoneId zone = ZoneId.systemDefault();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(zone);
String dt = df.format(Instant.ofEpochMilli(timestamp*1000));
Is there any built-in way to get a season by Zone? E.g. winter
, spring
, summer
or autumn
.