Possible Duplicate:
Get GMT Time in Java
I have taken the reference of the below 2 link :
link1 link2
But I want the GMT date in milliseconds.
Thanks In Advance.
You can use System.currentTimeMillis() it returns "the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC."
long time = System.currentTimeMillis();
Will do it :)
Use Calendar#getTimeInMillis
:
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
long time = cal.getTimeInMillis();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With