I have a code in java to generate a sitemap xml, and to get the last modified date using the following line of code:
oPrint.println(" <lastmod>"+ doc.getLastModified().toString()+"</lastmod>");

The output in the browser when calling the xml file is <lastmod>23/05/2014 16:48:24 ZE4</lastmod> which is in "dd/mm/yyyy"format.

However, from this link, https://support.google.com/webmasters/answer/183668?hl=en#183668, it states that the format has to be in YYYY-MM-DD format.

How can I convert my current output to the Google one?

Based on the above code, 05/05/2014 08:43:08 ZE4, how can I get it in the Google format, that is YYYY-MM-DDThh:mm:ssTZD

Thnks for the links stultuske, I was actually having problems to resolve the TimeZone from my initial string to convert to the new one, since I did not know what the ZE4 was standing for (since it was generated automatically), but found the solution in the end.

Edited 2 Years Ago by Ritesh_4

This question has already been answered. Start a new discussion instead.