Hi Ambika, As I suggested you earlier if you have a possibility of using 4.2.1 or up, you can get a very flexible XSLT compatible support for date/time formatting.
If not, one more thing that you can try is: 1) On a linux/unix machine in the same timezone, see what's the output of the strftime() system function. You may have to write a small c/c++ program to test it. 2) You can get details of system function strftime() using "man strftime" on linux/unix machines. 3) If possible, please test both the system function and MarkLogic function on the same machine. 4) If that produces different output than xdmp:strftime(), contact [email protected]<mailto:[email protected]>. Rgds, Gajanan From: [email protected] [mailto:[email protected]] On Behalf Of ambika arumugam Sent: Thursday, April 21, 2011 1:38 AM To: General MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Reg Time zone and daylight saving in marklogic Hi Gajanan, The mark logic version i am using is 4.1.6 The query i used is: let $datevalue := xs:dateTime("2011-04-20T09:05:00.000-05:00") return xdmp:strftime("%m/%d/%Y %H:%M:%S", xs:dateTime($datevalue)) it returned: 04/20/2011 19:35:00 which is one hour ahead of the local IST. How do i tackle this issue? it is related to daylight saving regards, Ambika On Thu, Apr 21, 2011 at 1:16 PM, Gajanan Chinchwadkar <[email protected]<mailto:[email protected]>> wrote: Hi Ambika, Which version of MarkLogic Server are you using? Can you please post the exact query and the output? If you are using MarkLogic server 4.2 and above, here is another possibility to print the dateTime in the format you want: Q1) let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00") return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01] [Z]"), returns: 04-20-11 09:05:00 -0500 Q2) let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00") return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01] [z]"), returns: 04-20-11 09:05:00 GMT-05:00 Q3) let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00") return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01]") returns: 04-20-11 09:05:00 Please note the [Z] in Q1, [z] in Q2 and neither in Q3. You can refer to W3C XSLT 2.0 spec for the exact syntax of format-dateTime() picture string, if you need more variations. Do you have any particular question about time-zone and daylight savings in MarkLogic that you are experimenting for? Rgds, Gajanan From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of ambika arumugam Sent: Wednesday, April 20, 2011 11:59 PM To: General MarkLogic Developer Discussion Subject: [MarkLogic Dev General] Reg Time zone and daylight saving in marklogic Hi all, I was just trying to understand about the time zone and the daylight saving in marklogic. The example I tried is as following: 1) I save a time with a time zone (say GMT -5:00 Eastern time (US and Canada)) (the data that I used looks like 2011-04-20T09:05:00.000-05:00) 2) I retrieve the time from the marklogic server and I pass the value to the xdmp:strftime() function to format the obtained value in the MM-DD-YY HH:MM:SS format. 3) In the output I obtain, I can see that the retrieved time is 1 hour ahead of my local time. My current local time zone is GMT +5:30 Is this advancement in time due to the daylight saving time setting? Can anyone please help me out? Thanks in advance. _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
