1 Reply Latest reply: Dec 2, 2012 7:25 PM by vladodias RSS

    Date formatting in XQuery

    MaitrayeeSarkar
      Hi All,

      How can I format a date in ddmmyyyyThh:mm:ss format in XQuery. Does OSB interprets date in yyyymmdd format by default?

      Edited by: 973598 on 2/12/2012 16:32
        • 1. Re: Date formatting in XQuery
          vladodias
          973598 wrote:
          How can I format a date in ddmmyyyyThh:mm:ss format in XQuery.
          Not really a beauty... But this will work...
                  concat(
                       day-from-dateTime($dateTime1),
                       month-from-dateTime($dateTime1),
                       year-from-dateTime($dateTime1),
                       "T",
                       hours-from-dateTime($dateTime1),
                       ":",
                       minutes-from-dateTime($dateTime1),
                       ":",
                       seconds-from-dateTime($dateTime1))
          Does OSB interprets date in yyyymmdd format by default?
          No, the expected format is ISO 8601...
          http://www.w3.org/TR/NOTE-datetime

          Examples
          1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
          1994-11-05T13:15:30Z corresponds to the same instant.

          Cheers,
          Vlad