I am a newbie in xquery and one of the requirement is to generate daily reports by querying xDB.
If I hardcode the date I am able to generate the report from xDB but if I try to read the current Date the from the system I don't get any values in report.
Code Snippet:
let $day := fn:current-date()
let $hours := ( '00', '01', '02', '03', '04',
'05', '06', '07', '08', '09',
'10', '11', '12', '13', '14',
'15', '16', '17', '18', '19',
'20', '21', '22', '23' )
let $ddhh := for $i in $hours return concat($day,"T",$i)
let $title := concat("Average Time By Documents in Hour on ", $day)
In report: ("Average Time By Documents in Hour on 2015-06-08Z"..)
The difference between hardcoded value and current-date() function is the timezone"Z". How do I get rid of timezone "Z". I only want say "2015-06-08" in variable $day and not "2015-06-08Z"
Thanks in advance.
If you want to get rid of the timezone component of the date, you can use
fn:adjust-date-to-timezone(), using an empty sequence as the second parameter: