Microsoft
Software
Hardware
Network
Question : java get utc date/time
I need to get the UTC/GMT current date/time. I'm using the below and it adds "-0700" at then end...is this code valid?
private String getCurrentDate(){
Calendar cal = new GregorianCalendar();
cal.setTimeZone(TimeZone.g
etTimeZone
("GMT"));
DateFormat formatter = new SimpleDateFormat("yyyy-MM-
dd'T'HH:mm
:ssZ");
return formatter.format(cal.getTi
me());
}
result of above is 2010-05-19T16:39:15-0700
Answer : java get utc date/time
take the Z out of the date format string
Random Solutions
Error Message popped up, Computer won't start up
operating system Vista works fine in safe mode but not regular mode
How do I create a looping to add values in columns?
How do I delete all my calander event in Outlook 2007?
Crystal Report in ASP web app Error Login failed for user 'MYDOMAIN\username'.
iPad css question - vertical scroll issue
flash comes up on firefox NOT ie
Lookup Multiple Records from a Form
Movie in Captivate 4
Copy what selected in a drop down to another drop down,