0

I have the following code:

java.util.TimeZone tz = java.util.TimeZone.getDefault();
System.out.println("Server DS Offset: " + tz.getDSTSavings());

Right now the Daylight saving is off, so I was expecting it to return 0, but it still returns 3600000.

Server is Solaris 10

date command returns:

Friday, November 11, 2016  4:27:12 PM EST

env returns:

TZ=Canada/Eastern
texasbruce
  • 13,867
  • 12
  • 57
  • 117

1 Answers1

1

How about Determine whether daylight savings time dst is active

What you got in your code is TimeZone attribute about what is offset for DST. In the world some offsets are 30 min. some do not have any. So, if Timezone follows DST then you got this value.

Community
  • 1
  • 1
Vadim
  • 3,851
  • 2
  • 8
  • 25