View Single Post
Old 23rd March 2011, 09:35   #15
Batter Pudding
Major Dude
Batter Pudding's Avatar
Join Date: Jun 2008
Posts: 1,665
Ah. They are very different dates now. Glad we have found why it was happening.

As you have Dreamweaver, I assume you are a website coder. So my suggestion would be to make a script to convert the date formats from one file and write it back to a fresh file. Or just some clever use of search and replace.

Are all of your dates from 2010 and 2011?

<date>Mon Dec 06 07:35:03 2010</date>

Look at the dates. The biggest pain is the "T". The rest is easy.

A search and replace on "<date>Mon ", "<date>Tue ", etc and replace with "<date>" would quickly strip the days we don't need. (Yes, repeat seven times for each day of the week)

Now for each month, "Dec " to "2010-12-". You will probably need to do some of this in batches to handle and 2009, 2011 dates depending on how many years data you have.

Same trick to change " 2010</date>" to "Z</date>"

This now gets us to this intermediate format:
<date>2010-12-06 07:35:03Z</date>

This just leaves us that annoying "T" to sort out. Can Dreamweaver do pattern matching in its search and replace? "<date>* *</date>" to "<date>*T*</date>" would be good.

OR... replace "-01 " with "-01T" but this needs repeating 31 times, and will need watching to make sure it doesn't trash other tags.

I don't work with XML, but I assume there are tools in Dreamweaver that could target date formats? Or could it be loaded into Excel, data split into columns. That would make it very easy to convert then. As long as the XML would export back out of Excel in a useable form.

Obviously the above is done on a COPY of your originally exported file.
Batter Pudding is offline   Reply With Quote