Reputation: 14174
I think I am missing something really simple but shouldn't this
long test = 1401894000; // GMT: Wed, 04 Jun 2014 15:00:00 GMT
DateTime dt = new DateTime(test);
Timber.d("TEST : %s", dt.toString("DD YYYY HH:mm"));
output
TEST : 04 2014 15:00
where what I see is
TEST : 17 1970 05:24
Im on Android
DateTimeZone.setDefault(DateTimeZone.UTC);
compile 'joda-time:joda-time:2.3'
Upvotes: 0
Views: 36
Reputation: 16394
1401894000
is milliseconds since Jan 1, 1970.
Which, if we work out is:
Which is between 5am and 6am on Jan 17 - which is the output you're seeing.
Upvotes: 1