Converting Epoch to string Date
I'm new here and though I'm not "new" to Java per se, I don't use it on a daily basis and I find that I need a little help with a conversion.
I have an attribute on an object (LAST_MODIFIED) whose value is a date in epoch format (e.g., 1197560243, which is Dec 13, 2007). I'm doing a little conversion based on some posts I read here, to get it into a readable format. That code looks like this:
private String convertDate( Long str )
Date epoch = new Date(str);
DateFormat df2 = DateFormat.getDateInstance(DateFormat.MEDIUM);
String s2 = df2.format(epoch);
The value of the converted date, however, always ends up being "Jan 14, 1970", which (obviously) isn't correct. Can anyone tell me where I'm going wrong? Any assistance is greatly appreciated!!
Amy. (who is exceedingly frustrated)