Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#20 static helper method for xsd:DateTime

open
nobody
None
5
2012-10-08
2004-12-23
David Thielen
No

Hi;

I think having a static helper method that returns the
datetime in the xsd format would be useful. Here is the
code:

SimpleDateFormat fmt = new SimpleDateFormat("yyyy-
MM-dd'T'HH:mm:'00Z'");
GregorianCalendar cal = new GregorianCalendar();
cal.add(Calendar.MILLISECOND, - TimeZone.getDefault
().getRawOffset());
return fmt.format(cal.getTime());

thanks - dave

Discussion