Tuesday, July 16, 2013

currentTimeMillis reverse lookup, AKA "from currentTimeMillis to date" in WLST

If you have a timestamp expressed as

System.currentTimeMillis()

=1373941644513  

you can transform it into a readable date this way:

from java.text import SimpleDateFormat 
from java.util import Date

sdf = SimpleDateFormat("MMM dd,yyyy HH:mm")
mydate = Date(1373941644513)
print sdf.format(mydate)

Jul 16,2013 04:27




No comments: