What is XQuery dateTime function in XML

In this article, we will discuss about dateTime function in XQuery
  • 1877

dateTime Function

The dateTime function in XQuery converts the arguments to a date and a time. xs:dateTime value representing the year, month, day, hour, minute and second. It contain two arguments-

  • xs:date arguments gives date value and it also contains value of-
     
    1. year is an xs:anyAtomicType, returned year value.
    2. month is an xs:anyAtomicType, returned month value.
    3. day is an xs:anyAtomicType, returned day value.
       
  • xs:time arguments time value and it contains value of-
     
    1. hour is an xs:anyAtomicType, returned year value.
    2. minute is an xs:anyAtomicType, returned month value.
    3. second is an xs:anyAtomicType, returned day value.

Syntax of dateTime function

fn:dateTime(dateValue,timeValue)


Example of dateTime Function
 

fn:dateTime(2012,7,12,20,6,12) is gives 2012-07-12T20:06:12

Further Readings

You may also want to read these related articles:
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.