I knew it would have been something I was missing! By the way I was trying my own current-dateTime based on prof:current-ms but I was not yet aware about convert:integer-to-dateTime! Always learning something new!
THANKS!
M.
On 01/02/2017 19:58, Christian GrĂ¼n wrote:
Hi Marco,
fn:current-dateTime is determinstic [1]; as such, it will return the same value within the same query.
Try this here instead [2]:
convert:integer-to-dateTime(prof:current-ms())
Cheers, Christian
[1] https://www.w3.org/TR/xpath-functions-31/#func-current-dateTime [2] http://docs.basex.org/wiki/Profiling_Module#prof:current-ms
On Wed, Feb 1, 2017 at 7:50 PM, Marco Lettere m.lettere@gmail.com wrote:
Hello all,
when running the following query:
hof:until( function($i){ $i = 10}, function($i){ (admin:write-log(xs:string(current-dateTime()) || " -- " || $i), prof:sleep(1000), $i + 1)}, 0 )
I get the following output:
19:49:07.400 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 0 19:49:08.400 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 1 19:49:09.401 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 2 19:49:10.402 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 3 19:49:11.403 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 4 19:49:12.404 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 5 19:49:13.405 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 6 19:49:14.406 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 7 19:49:15.407 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 8 19:49:16.408 SERVER admin INFO 2017-02-01T19:49:07.399+01:00 -- 9
I would expect current-dateTime() to return a dateTime that increases by one second on every output. What is wrong with my understanding?
Thanks,
Marco.