I’m doing this app and I’m having some very weird issues on the Date that I can only assume it’s a bug. Currently the UI is only a test mode to see if I’m getting the right data from the servers. For debugging I included this line in the adapter getView I’m using on my list view
Log.d(DEBUG_TAG, "date: " + item.date.toString() + "; long: " + item.date.getTime());
As I said, that’s only testing the data and I don’t care about the formatting, the UI is not important, later on I’ll be using DateFormater or SimpleDateFormarter.
But at the moment this line is giving me Logs like this:
date: Fri Jan 16 15:30:14 GMT 1970; long: 1348214602
and if you throw that long on http://www.epochconverter.com/ you’ll see the correct value that is some time around today (September 2012), but why is that .toString() giving me January 1970 ???
Has anyone seen that?
edit:
the date object is being created as:
new Date(miliSeconds)
I’ve already checked during the instantiation time and the value is the same returned by getTime()
Multiply your date by 1000. Somehow you are using seconds instead of miliseconds.