Forum Stats

  • 3,854,243 Users
  • 2,264,344 Discussions
  • 7,905,621 Comments

Discussions

xQuery: How to convert a xs:dateTime to UTC based on the value in the column?

user8958419
user8958419 Member Posts: 81

I have a xquery where I am mapping as below:

<ns0:REV_DTE>{data(fn-bea:dateTime-to-string-with-format('MMM-dd-yyyy HH:mm:ss',fn:adjust-dateTime-to-timezone(fn-bea:dateTime-from-string-with-format('MMM-dd-yyyy HH:mm:ss',$ns1:IssueDate))))}</ns0:REV_DTE>    

I want the result as below:

If IssueDate = Feb-09-2017 11:13:00 then the converted date should be  Feb-09-2017 16:13:00 irrespective of when I am doing the conversion. Currently, if I run the piece of code today, I get back  Feb-09-2017 15:13:00  since the time difference between EST and UTC now is 4 hours where as on Feb-09 the time difference was 5 hours.

Basically what I want is the time to adjust based on the datetime passed in and not on the current date. I hope my question makes sense.         

This discussion has been closed.