1

Following is my java code snippet.

Timestamp ts = Timestamp.valueOf("1900-12-31 23:59:59.999");
System.out.println("ts=====>" + ts.getTime());

oracle jdk result is

ts=====>-2177483400001

ibm jdk(IBM J9 VM (build 2.3, J2RE 1.5.0) result is

ts=====>-2177483272001

Why these two values are different?

Chirag Parmar
  • 833
  • 11
  • 26
Steve Park
  • 51
  • 6
  • 1
    At a guess, the two JDKs are treating them as different time zones. – Powerlord Nov 09 '16 at 08:12
  • @Powerlord I doubt it. I don't know of any two time zones that are 128 seconds apart. – Dawood ibn Kareem Nov 09 '16 at 08:13
  • I'd say this is a bug that you should report to IBM. The result that you say the IBM JVM gave you is obviously incorrect. Unless there's some kind of 128 second time discontinuity that I've never heard of (similar to the famous 352 second discontinuity of 1927). – Dawood ibn Kareem Nov 09 '16 at 08:21
  • @DavidWallace How about timezones that are 353 seconds apart instead of 128? http://stackoverflow.com/questions/6841333/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result Actually OP's question is probably a duplicate of that one. – walen Nov 09 '16 at 08:27
  • My previous comment implies that it's not a duplicate. – Dawood ibn Kareem Nov 09 '16 at 08:37

0 Answers0