Java Time conversion

Hi I know this must a simple thing to do in Java but I can't seem to find it. I need to convert UTC time in millisec into GMT regular time. i.e.1155000000000 should be converted to Tue Aug 8 01:20:00:000 GMT 2006Thnx
[252 byte] By [mk47a] at [2007-10-3 2:34:05]
# 1

Hi,

all you need is this:

long timemil = 1155000000000; //your millis value

Date date = new Date(timemil);

date.toString(); //returns date in classic GMT format

JoYiCk

JoYsTiCka at 2007-7-14 19:33:06 > top of Java-index,Java Essentials,New To Java...
# 2
Thanks. but 1155000000000 is too big for a long and Date constructor doesn't accept a string.
mk47a at 2007-7-14 19:33:06 > top of Java-index,Java Essentials,New To Java...
# 3
Just add L at the end of the number. Sorry I forgot before.long timemil = 1155000000000L; //your millis valueJoYiCkMessage was edited by: JoYsTiCk
JoYsTiCka at 2007-7-14 19:33:06 > top of Java-index,Java Essentials,New To Java...
# 4

Known bug with forum software: the "L" at the end of a long doesn't show up within code tags. If you put *two* L's at the end of the long, then one L will show up.

One L:

long num = 15823059823;

Two Ls:

long num = 15823059823L;

MLRona at 2007-7-14 19:33:06 > top of Java-index,Java Essentials,New To Java...
# 5
Thank you, I have noticed it too late ;-)
JoYsTiCka at 2007-7-14 19:33:06 > top of Java-index,Java Essentials,New To Java...
# 6
> One L:Mojo.> Two Ls:Extra mojo with the kung-fu grip.~
yawmarka at 2007-7-14 19:33:06 > top of Java-index,Java Essentials,New To Java...