To register for the forums, please contact your Digital-Clay representative.

XML data injection date problem

Community-oriented help and tech-support for the Digital-Clay platform.
Post Reply
aperfectpoint
Posts: 4
Joined: Sun Sep 06, 2009 12:35 pm

XML data injection date problem

Post by aperfectpoint »

Hi,

I use the XML data injection to inject to a date & time field. Does the date format is set by the computer regional settings? On two different Centrals, I injected in the format mm/dd/yyyy. The date 03/01/2010 was treated differently: in one central it remained the same, and on the other it switched to 01/03/2010. I could not find anywhere on the Clay settings to set the date format (which would clearly fix the problem).

Thanks
ZevToledano
Posts: 722
Joined: Fri Apr 03, 2009 2:29 pm

Re: XML data injection date problem

Post by ZevToledano »

Date strings are converted to the best of its ability using Windows Regional Settings as guidelines. Here are things to try:

1. Set the date format order in Windows Regional Settings control panel to match your date order.

2. Use month names in your dates (1/Feb/2000 instead of 1/2/2000)

3. The most reliable way that would work on ANY computer, is to convert your dates to a Microsoft date number which is calculated by counting the number of days since 12/30/1899. E.g. 7/7/93 = 34157.
aperfectpoint
Posts: 4
Joined: Sun Sep 06, 2009 12:35 pm

Re: XML data injection date problem

Post by aperfectpoint »

Thanks,
After failing with the 2nd option, I tried the 3rd option, but since I'm using Date&Time (not just date) I'm not sure what number should I insert, in order to get also hours and minutes (and seconds?). I tried adding zeros to the right (thinking of seconds resolution), and also tried the format <Microsoft date number> <hh:mm>, none worked...
ZevToledano
Posts: 722
Joined: Fri Apr 03, 2009 2:29 pm

Re: XML data injection date problem

Post by ZevToledano »

What value did you get when you used the 2nd option? There is no way it can mistake 'Feb' as a day value, unless it is failing to format it because of other characters in the date string and therefore it will result in 0s. Perhaps you should provide some examples that are failing.

If you are going for the third option then simply calculate the time based on 1=one day. So .5 is 12:00:00 and one second is 1/(24*60*60).
For example, "1/1/2000 12:30:30" = 36526.5211805556
Post Reply