In my web service, there is an endpoint that returns me a timestamp in UTC
and I have a method that generates a date formatted from this timestamp:
formatDate(1432313391, "UTC");
public String formatDate(long date, String timeZone)
{
//Neste caso, o Locale está como ENGLISH (default do aparelho)
DateFormat f = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM, Locale.getDefault());
f.setTimeZone(TimeZone.getTimeZone(timeZone));
return f.format(date);
}
But for some reason this method is returning me to the following String:
Jan 17, 1970 1:51:53 PM
If you convert this date into some converter it looks like:
5/22/2015, 1:49:51 PM
Anyone have an idea why?