Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare function local:milliseconds-since-epoch($dateTime as xs:dateTime) as xs:integer
- {
- let $epoch := xs:dateTime("1970-01-01T00:00:00Z")
- let $duration := xs:duration($dateTime - $epoch)
- let $days := fn:days-from-duration($duration) * 8.64e+7
- let $hours := fn:hours-from-duration($duration) * 3.6e+6
- let $minutes := fn:minutes-from-duration($duration) * 60000
- let $seconds := fn:seconds-from-duration($duration) * 1000
- return xs:integer($days + $hours + $minutes + $seconds)
- };
- local:milliseconds-since-epoch(fn:current-dateTime())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement