View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
KWarner KWarner is offline
external usenet poster
 
Posts: 9
Default Excel 2007 export/import datetime

Wouter HM, thanks for your time.
27:59 = 1/1/1900 3:59 AM - our workday goes from 4:00 AM to 3:59 AM. I
can't just have 1:00 AM be 1:00 AM because then it doesn't sort correctly -
1:00 AM needs to come after 11:00 PM. Therefore, 1:00 AM has to be 25:00.

My xsd definition has the "Time" column as dateTime. So, when a time-only
value gets exported (i.e. 16:47) it tacks the date on like this:
"<Time1899-12-31T16:47:00.000</Time". Excel doesn't like the year 1899,
so I am unable to import this as dateTime, it actually gets imported as text.
I could add a day to all records before export and then subtract a day after
import, but there are over 2000 records. This is just another kludgy
workaround and my other kludgy workaround is faster, even though using 1904
date system is generally a bad idea.

"Wouter HM" wrote:

Hi KWarner,

The time peiode 04:00 - 27:59 looks odd, but you might need it.
From the top of my head I suggest just before exporting to XML
subtract 4 hours from the values in the Time column.
After export add those 4 hours.

Also after imprting the values add 4 hours to these impoted values.

HTH,

Wouter
.