Microsoft
Software
Hardware
Network
Question : Xquery assign datetime variable
hi,
i have the following code
current-time() + xs:dayTimeDuration(string(
concat('PT
', $i, 'M')))
which uses the current-time() function from xquery and adds mins to it.
let's say i want to subsitute the current-time() with a date time in string format
25/12/2006 15:00:30
how do i go about doing it?
thanks.
Answer : Xquery assign datetime variable
given that the time value lands in a variable $time
let $time := "25/12/2006 15:00:30"
you can cast to the dataTime format like this
xs:dateTime(replace($time,
'(\d+)/(\d+)/(\d+)\s+(.*)$
', '$3-$2-$1T$4'))
Random Solutions
Debug and Trace Information
How to display users who have not submitted their reports.
Hyperlink to an attachment in Outlook
Stacked Column Chart - Excel 2007
How to update all records except for current day within Microsoft Access query?
Identify apostrphie in excel sheet
(Another) Extract data from HTML table
SDK for linux
How to sum a formula involving a nested if statement in Crystal 2008
Visual Basic 6 -- How to check if port is 'established' with Winsock or an alternative?