#20 static helper method for xsd:DateTime

open
nobody
None
5
2012-10-08
2004-12-23
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


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks