Created
April 21, 2014 14:01
-
-
Save joewiz/11143603 to your computer and use it in GitHub Desktop.
How many days have you been alive, with XQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
declare function local:days-since-date($date as xs:date) { | |
let $duration := current-date() - $date | |
let $days := days-from-duration($duration) | |
return | |
$days | |
}; | |
local:days-since-date(xs:date('2012-10-12')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment