Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. declare function local:milliseconds-since-epoch($dateTime as xs:dateTime) as xs:integer
  2. {
  3. let $epoch := xs:dateTime("1970-01-01T00:00:00Z")
  4. let $duration := xs:duration($dateTime - $epoch)
  5. let $days := fn:days-from-duration($duration) * 8.64e+7
  6. let $hours := fn:hours-from-duration($duration) * 3.6e+6
  7. let $minutes := fn:minutes-from-duration($duration) * 60000
  8. let $seconds := fn:seconds-from-duration($duration) * 1000
  9. return xs:integer($days + $hours + $minutes + $seconds)
  10. };
  11.  
  12. local:milliseconds-since-epoch(fn:current-dateTime())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement