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
Monitor For Only Specific Words
Router setup
How to use datacontractserialization
Windows 2000 crash
Excel VBA: How to run dynamically created code/string
jquery move a set of form input fields
what javascript will loop through an array or evaluate a list for the following error checking javascript enbedded within a ColdFusion 9 form?
Setting up an FTP site on SBS2008
Wallpaper Settings in Roaming Profiles
How to setup a remote office using Small Business Server