raw timestamp

Hello there,Does anyone know what raw timestamp is? and how can it be transformed into sensible format?Thanks
[130 byte] By [dd007007a] at [2007-10-2 0:54:21]
# 1
its the time in milliseconds in long format
kilyasa at 2007-7-15 18:14:12 > top of Java-index,Java Essentials,New To Java...
# 2

if you look at The System class in the java API, heres the method you could use to get raw time

currentTimeMillis

public static long currentTimeMillis()Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.

See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).

Returns:

the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.

kilyasa at 2007-7-15 18:14:12 > top of Java-index,Java Essentials,New To Java...
# 3
Thank you kilyas for your reply!I have time in int, and it is called raw timestamp :(for exampe:136787885136876768138216419I can find to convert long value to a timestamp, but for int, I can not find anything...
dd007007a at 2007-7-15 18:14:12 > top of Java-index,Java Essentials,New To Java...
# 4

So what if it's in an int instead of a long?

int timestamp = 136787885;

Date date = new Date(timestamp);

You should not be storing a raw timestamp in an int variable.

The maximum value of int is 2^31-1. So your clock already wraps around after 2,147,483,647 milliseconds = 35,791.35 minutes = 596.5 hours = 24.8 days.

Your clock won't be able to go past January, 1970 if you store the raw timestamp in an int.

jesperdja at 2007-7-15 18:14:12 > top of Java-index,Java Essentials,New To Java...
# 5
thank you very much for your reply!
dd007007a at 2007-7-15 18:14:12 > top of Java-index,Java Essentials,New To Java...