I have a problem displaying a series of dates that are stored as longs. I create date objects with a constructor that takes a long argument, and then prints the dates to a PDF file.
However, I have a problem with old dates when running a program on Linux compared to Windows.
Take this date: April 25, 1976 00:00:00 (long cost: 199231200000L), for example. If I use the dateformater to display the date, it will display differently on Linux and Windows:
Windows: April 25, 1976 00:00:00 CEST
On Linux: 24.April 1976 23:00:00 CET
Text rep. you can simply start by running the following line:
DateFormat.getDateTimeInstance( DateFormat.FULL, DateFormat.FULL ).format( new Date( 199231200000L) )
I used Joda Time to get the date value for this test:
new org.joda.time.DateTime().withDate( 1976, 4, 25 ).withTime( 0, 0, 0, 0 ).toDate().getTime()
Why does Windows show output as CEST and Linux as CET?
source share