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
A Nice Clean Title with Underline (Help with Style Needed)
Website name in other country question about registering if you live in USA
HTML: How to find out if a browser can display png with transparent areas correctly
Access 2007 is locked for one user only
Mysql server does not ask for password (Password is already set )
Cpanel - 301 redirect parked domains on one account
where to buy the correct aspect ratio
Is there a quick way to change all Active Directory user aliases to lower case?
451 4.4.0 Primary target IP address responded with: ""554 mail.domain.gov""
outer joins in MS Access