current-dateTime() function precision

Friday, 9 September 2022 · 9 messages
MH
Martin Honnenin reply to ykhabins, 9 Sep 2022, 19:559 Sep 2022 18:03 #
Quoted text · ykhabins · 58 lines
Am 9/9/2022 um 5:55 PM schrieb ykhabins at bellsouth.net: > Hello, > > I am using BaseX v.10.1 > > It seems that the current-dateTime() function precision is off. > > I am validating an XML file against an XSD 1.1 file via Xerces 2.12.2 > validator. > And trying to measure a timing of it. > > Here is my code. > xquery version "4.0"; > > let $xml := '\\...\AForm-XSD-20211013\PD220224062681.XML' > let $xsd := '\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd' > > let $before_datetime := current-dateTime() > let $result := validate:xsd-report($xml, $xsd, map { > 'http://apache.org/xml/features/validation/cta-full-xpath-checking': true() > }) > > return <root><metadata> > <result>{data($result/status)}</result> > <errors>{count($result/message)}</errors> > <startTime>{$before_datetime}</startTime> > <endTime>{current-dateTime()}</endTime> > <xmlFile>{$xml}</xmlFile> > <xsdFile>{$xsd}</xsdFile> > <xsdProcessor>BaseX {data(db:system()//version)}, EE-Java, > {validate:xsd-processor()} 2.12.2</xsdProcessor> > <xsdVersion>{validate:xsd-version()}</xsdVersion> > </metadata> > <messages>{$result/message}</messages> > </root> > > It is emitting the following output: > <root> > <metadata> > <result>invalid</result> > <errors>3</errors> > <startTime>2022-09-09T11:32:29.667-04:00</startTime> > <endTime>2022-09-09T11:32:29.667-04:00</endTime> > <xmlFile>\\...\AForm-XSD-20211013\PD220224062681.XML</xmlFile> > <xsdFile>\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd</xsdFile> > <xsdProcessor>BaseX 10.1, EE-Java, Xerces 2.12.2</xsdProcessor> > <xsdVersion>1.1</xsdVersion> > </metadata> > <messages> > ... > </messages> > </root> > > The question is why the before and after timing is the same: > <startTime>2022-09-09T11:32:29.667-04:00</startTime> > <endTime>2022-09-09T11:32:29.667-04:00</endTime> > > They are identical up to a millisecond.
I think, due to the functional/declarative language that is XQuery, the static context defines that current-dateTime() doesn't change during the execution of a single query, it is part of the static context. Most processors have extensions for timestamp and/or profiling, e.g. Saxon has saxon:timestamp(), I would think that BaseX also has some extension.
MH
Martin Honnen9 Sep 2022 18:05 #
Quoted text · Martin Honnen · 71 lines
Am 9/9/2022 um 6:03 PM schrieb Martin Honnen: > > Am 9/9/2022 um 5:55 PM schrieb ykhabins at bellsouth.net: >> Hello, >> >> I am using BaseX v.10.1 >> >> It seems that the current-dateTime() function precision is off. >> >> I am validating an XML file against an XSD 1.1 file via Xerces 2.12.2 >> validator. >> And trying to measure a timing of it. >> >> Here is my code. >> xquery version "4.0"; >> >> let $xml := '\\...\AForm-XSD-20211013\PD220224062681.XML' >> let $xsd := '\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd' >> >> let $before_datetime := current-dateTime() >> let $result := validate:xsd-report($xml, $xsd, map { >> 'http://apache.org/xml/features/validation/cta-full-xpath-checking': >> true() >> }) >> >> return <root><metadata> >> <result>{data($result/status)}</result> >> <errors>{count($result/message)}</errors> >> <startTime>{$before_datetime}</startTime> >> <endTime>{current-dateTime()}</endTime> >> <xmlFile>{$xml}</xmlFile> >> <xsdFile>{$xsd}</xsdFile> >> <xsdProcessor>BaseX {data(db:system()//version)}, EE-Java, >> {validate:xsd-processor()} 2.12.2</xsdProcessor> >> <xsdVersion>{validate:xsd-version()}</xsdVersion> >> </metadata> >> <messages>{$result/message}</messages> >> </root> >> >> It is emitting the following output: >> <root> >> <metadata> >> <result>invalid</result> >> <errors>3</errors> >> <startTime>2022-09-09T11:32:29.667-04:00</startTime> >> <endTime>2022-09-09T11:32:29.667-04:00</endTime> >> <xmlFile>\\...\AForm-XSD-20211013\PD220224062681.XML</xmlFile> >> <xsdFile>\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd</xsdFile> >> <xsdProcessor>BaseX 10.1, EE-Java, Xerces 2.12.2</xsdProcessor> >> <xsdVersion>1.1</xsdVersion> >> </metadata> >> <messages> >> ... >> </messages> >> </root> >> >> The question is why the before and after timing is the same: >> <startTime>2022-09-09T11:32:29.667-04:00</startTime> >> <endTime>2022-09-09T11:32:29.667-04:00</endTime> >> >> They are identical up to a millisecond. > > > I think, due to the functional/declarative language that is XQuery, the > static context defines that current-dateTime() doesn't change during the > execution of a single query, it is part of the static context. > > Most processors have extensions for timestamp and/or profiling, e.g. > Saxon has saxon:timestamp(), I would think that BaseX also has some > extension. >
MH
Martin Honnenin reply to Martin Honnen, 9 Sep 2022, 18:039 Sep 2022 18:08 #
Quoted text · Martin Honnen · 4 lines
Am 9/9/2022 um 6:03 PM schrieb Martin Honnen: > I think, due to the functional/declarative language that is XQuery, the > static context defines that current-dateTime() doesn't change during the > execution of a single query, it is part of the static context.
It is defined in the dynamic context: https://www.w3.org/TR/xquery-31/#eval_context * [Definition:*Current dateTime.*This information represents animplementation-dependent <https://www.w3.org/TR/xquery-31/#dt-implementation-dependent>point in time during the processing ofa query, and includes an explicit timezone. It can be retrieved by the|fn:current-dateTime|function. If invoked multiple times during the execution ofa query, this function always returns the same result.]
LV
Lizzi, Vincentin reply to ykhabins, 9 Sep 2022, 19:559 Sep 2022 19:25 #
Hello Yitzhak, The current-dateTime() function returns the same value throughout the execution of a single query. The Profiling module has functions that provide the current system time, which is probably more to what you need. https://docs.basex.org/wiki/Profiling_Module Kind regards, Vincent _____________________________________________ Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group vincent.lizzi at taylorandfrancis.com<mailto:vincent.lizzi at taylorandfrancis.com> Information Classification: General
Quoted text · BaseX-Talk · 55 lines
From: BaseX-Talk <basex-talk-bounces at mailman.uni-konstanz.de> On Behalf Of ykhabins at bellsouth.net Sent: Friday, September 9, 2022 11:55 AM To: 'BaseX' <basex-talk at mailman.uni-konstanz.de> Subject: [basex-talk] current-dateTime() function precision Hello, I am using BaseX v.10.1 It seems that the current-dateTime() function precision is off. I am validating an XML file against an XSD 1.1 file via Xerces 2.12.2 validator. And trying to measure a timing of it. Here is my code. xquery version "4.0"; let $xml := '\\...\AForm-XSD-20211013\PD220224062681.XML' let $xsd := '\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd' let $before_datetime := current-dateTime() let $result := validate:xsd-report($xml, $xsd, map { 'http://apache.org/xml/features/validation/cta-full-xpath-checking<http://apache.org/xml/features/validation/cta-full-xpath-checking>': true() }) return <root><metadata> <result>{data($result/status)}</result> <errors>{count($result/message)}</errors> <startTime>{$before_datetime}</startTime> <endTime>{current-dateTime()}</endTime> <xmlFile>{$xml}</xmlFile> <xsdFile>{$xsd}</xsdFile> <xsdProcessor>BaseX {data(db:system()//version)}, EE-Java, {validate:xsd-processor()} 2.12.2</xsdProcessor> <xsdVersion>{validate:xsd-version()}</xsdVersion> </metadata> <messages>{$result/message}</messages> </root> It is emitting the following output: <root> <metadata> <result>invalid</result> <errors>3</errors> <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> <xmlFile>\\...\AForm-XSD-20211013\PD220224062681.XML</xmlFile<file://.../AForm-XSD-20211013/PD220224062681.XML%3c/xmlFile>> <xsdFile>\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd</xsdFile<file://.../AForm-XSD-20211013/Miami-ws-AForm.xsd%3c/xsdFile>> <xsdProcessor>BaseX 10.1, EE-Java, Xerces 2.12.2</xsdProcessor> <xsdVersion>1.1</xsdVersion> </metadata> <messages> ... </messages> </root> The question is why the before and after timing is the same: <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> They are identical up to a millisecond. My expectations were that at least the millisecond time portion would be different. Regards, Yitzhak Khabinsky
MH
Martin Honnenin reply to ykhabins, 9 Sep 2022, 21:469 Sep 2022 19:54 #
Quoted text · ykhabins at bellsouth.net · 24 lines
On 9/9/2022 7:46 PM, ykhabins at bellsouth.net wrote: > > Hi Vincent and Martin, > > Thanks for the clarification. > > I switched to using the Profiling module. > > let $before_datetime := convert:integer-to-dateTime(prof:current-ms()) > (: current-dateTime() :) > > And it is working well. > > <startTime>2022-09-09T17:31:34.466Z</startTime> > > <endTime>2022-09-09T17:31:34.538Z</endTime> > > The last remaining task is to convert the output from the UTC time > zone to my local EST: > > <startTime>2022-09-09T13:31:34.466-04:00</startTime> > > Any idea how to achieve that? >
There is a function adjust-dateTime-to-timezone, taking a duration, I think.
LV
Lizzi, Vincentin reply to ykhabins, 9 Sep 2022, 21:469 Sep 2022 19:54 #
Hi Yitzhak The adjust-dateTime-to-timezone function may do what you need. For example, this converts the current time to UTC. adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration('PT0H')) For EDT, change the duration to "-PT4H". The duration that is needed for US Eastern time will vary depending on the time of year. See https://maxtoroq.github.io/xpath-ref/fn/adjust-dateTime-to-timezone.html Kind regards, Vincent _____________________________________________ Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group vincent.lizzi at taylorandfrancis.com<mailto:vincent.lizzi at taylorandfrancis.com> Information Classification: General
Quoted text · ykhabins at bellsouth.net · 85 lines
From: ykhabins at bellsouth.net <ykhabins at bellsouth.net> Sent: Friday, September 9, 2022 1:46 PM To: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com>; 'BaseX' <basex-talk at mailman.uni-konstanz.de> Subject: RE: [basex-talk] current-dateTime() function precision Hi Vincent and Martin, Thanks for the clarification. I switched to using the Profiling module. let $before_datetime := convert:integer-to-dateTime(prof:current-ms()) (: current-dateTime() :) And it is working well. <startTime>2022-09-09T17:31:34.466Z</startTime> <endTime>2022-09-09T17:31:34.538Z</endTime> The last remaining task is to convert the output from the UTC time zone to my local EST: <startTime>2022-09-09T13:31:34.466-04:00</startTime> Any idea how to achieve that? Regards, Yitzhak Khabinsky From: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com<mailto:Vincent.Lizzi at taylorandfrancis.com>> Sent: Friday, September 9, 2022 1:26 PM To: ykhabins at bellsouth.net<mailto:ykhabins at bellsouth.net>; 'BaseX' <basex-talk at mailman.uni-konstanz.de<mailto:basex-talk at mailman.uni-konstanz.de>> Subject: RE: [basex-talk] current-dateTime() function precision Hello Yitzhak, The current-dateTime() function returns the same value throughout the execution of a single query. The Profiling module has functions that provide the current system time, which is probably more to what you need. https://docs.basex.org/wiki/Profiling_Module<https://docs.basex.org/wiki/Profiling_Module> Kind regards, Vincent Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group vincent.lizzi at taylorandfrancis.com<mailto:vincent.lizzi at taylorandfrancis.com> Information Classification: General From: BaseX-Talk <basex-talk-bounces at mailman.uni-konstanz.de<mailto:basex-talk-bounces at mailman.uni-konstanz.de>> On Behalf Of ykhabins at bellsouth.net<mailto:ykhabins at bellsouth.net> Sent: Friday, September 9, 2022 11:55 AM To: 'BaseX' <basex-talk at mailman.uni-konstanz.de<mailto:basex-talk at mailman.uni-konstanz.de>> Subject: [basex-talk] current-dateTime() function precision Hello, I am using BaseX v.10.1 It seems that the current-dateTime() function precision is off. I am validating an XML file against an XSD 1.1 file via Xerces 2.12.2 validator. And trying to measure a timing of it. Here is my code. xquery version "4.0"; let $xml := '\\...\AForm-XSD-20211013\PD220224062681.XML' let $xsd := '\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd' let $before_datetime := current-dateTime() let $result := validate:xsd-report($xml, $xsd, map { 'http://apache.org/xml/features/validation/cta-full-xpath-checking<http://apache.org/xml/features/validation/cta-full-xpath-checking>': true() }) return <root><metadata> <result>{data($result/status)}</result> <errors>{count($result/message)}</errors> <startTime>{$before_datetime}</startTime> <endTime>{current-dateTime()}</endTime> <xmlFile>{$xml}</xmlFile> <xsdFile>{$xsd}</xsdFile> <xsdProcessor>BaseX {data(db:system()//version)}, EE-Java, {validate:xsd-processor()} 2.12.2</xsdProcessor> <xsdVersion>{validate:xsd-version()}</xsdVersion> </metadata> <messages>{$result/message}</messages> </root> It is emitting the following output: <root> <metadata> <result>invalid</result> <errors>3</errors> <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> <xmlFile>\\...\AForm-XSD-20211013\PD220224062681.XML</xmlFile<file://.../AForm-XSD-20211013/PD220224062681.XML%3c/xmlFile>> <xsdFile>\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd</xsdFile<file://.../AForm-XSD-20211013/Miami-ws-AForm.xsd%3c/xsdFile>> <xsdProcessor>BaseX 10.1, EE-Java, Xerces 2.12.2</xsdProcessor> <xsdVersion>1.1</xsdVersion> </metadata> <messages> ... </messages> </root> The question is why the before and after timing is the same: <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> They are identical up to a millisecond. My expectations were that at least the millisecond time portion would be different. Regards, Yitzhak Khabinsky
Y
ykhabins9 Sep 2022 19:55 #
Hello, I am using BaseX v.10.1 It seems that the current-dateTime() function precision is off. I am validating an XML file against an XSD 1.1 file via Xerces 2.12.2 validator. And trying to measure a timing of it. Here is my code. xquery version "4.0";
let $xml := '\\...\AForm-XSD-20211013\PD220224062681.XML'
let $xsd := '\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd'

let $before_datetime := current-dateTime()
let $result := validate:xsd-report($xml, $xsd, map {
'http://apache.org/xml/features/validation/cta-full-xpath-checking': true()
})

return <root><metadata>
    <result>{data($result/status)}</result>
    <errors>{count($result/message)}</errors>
    <startTime>{$before_datetime}</startTime>
    <endTime>{current-dateTime()}</endTime>
    <xmlFile>{$xml}</xmlFile>
    <xsdFile>{$xsd}</xsdFile>
    <xsdProcessor>BaseX {data(db:system()//version)}, EE-Java,
{validate:xsd-processor()} 2.12.2</xsdProcessor>
    <xsdVersion>{validate:xsd-version()}</xsdVersion>
  </metadata>
  <messages>{$result/message}</messages>
</root>
It is emitting the following output:
<root>
  <metadata>
    <result>invalid</result>
    <errors>3</errors>
    <startTime>2022-09-09T11:32:29.667-04:00</startTime>
    <endTime>2022-09-09T11:32:29.667-04:00</endTime>
    <xmlFile>\\...\AForm-XSD-20211013\PD220224062681.XML</xmlFile>
    <xsdFile>\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd</xsdFile>
    <xsdProcessor>BaseX 10.1, EE-Java, Xerces 2.12.2</xsdProcessor>
    <xsdVersion>1.1</xsdVersion>
  </metadata>
  <messages>
    ...
  </messages>
</root>
The question is why the before and after timing is the same: <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> They are identical up to a millisecond. My expectations were that at least the millisecond time portion would be different. Regards, Yitzhak Khabinsky
Y
ykhabinsin reply to Lizzi, Vincent, 9 Sep 2022, 19:259 Sep 2022 21:46 #
Hi Vincent and Martin, Thanks for the clarification. I switched to using the Profiling module. let $before_datetime := convert:integer-to-dateTime(prof:current-ms()) (: current-dateTime() :) And it is working well.
<startTime>2022-09-09T17:31:34.466Z</startTime>

<endTime>2022-09-09T17:31:34.538Z</endTime>
The last remaining task is to convert the output from the UTC time zone to my local EST:
<startTime>2022-09-09T13:31:34.466-04:00</startTime>
Any idea how to achieve that? Regards, Yitzhak Khabinsky
Quoted text · Lizzi, Vincent · 77 lines
From: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> Sent: Friday, September 9, 2022 1:26 PM To: ykhabins at bellsouth.net; 'BaseX' <basex-talk at mailman.uni-konstanz.de> Subject: RE: [basex-talk] current-dateTime() function precision Hello Yitzhak, The current-dateTime() function returns the same value throughout the execution of a single query. The Profiling module has functions that provide the current system time, which is probably more to what you need. https://docs.basex.org/wiki/Profiling_Module Kind regards, Vincent Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group <mailto:vincent.lizzi at taylorandfrancis.com> vincent.lizzi at taylorandfrancis.com Information Classification: General From: BaseX-Talk <basex-talk-bounces at mailman.uni-konstanz.de <mailto:basex-talk-bounces at mailman.uni-konstanz.de> > On Behalf Of ykhabins at bellsouth.net <mailto:ykhabins at bellsouth.net> Sent: Friday, September 9, 2022 11:55 AM To: 'BaseX' <basex-talk at mailman.uni-konstanz.de <mailto:basex-talk at mailman.uni-konstanz.de> > Subject: [basex-talk] current-dateTime() function precision Hello, I am using BaseX v.10.1 It seems that the current-dateTime() function precision is off. I am validating an XML file against an XSD 1.1 file via Xerces 2.12.2 validator. And trying to measure a timing of it. Here is my code. xquery version "4.0"; let $xml := '\\...\AForm-XSD-20211013\PD220224062681.XML' let $xsd := '\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd' let $before_datetime := current-dateTime() let $result := validate:xsd-report($xml, $xsd, map { 'http://apache.org/xml/features/validation/cta-full-xpath-checking': true() }) return <root><metadata> <result>{data($result/status)}</result> <errors>{count($result/message)}</errors> <startTime>{$before_datetime}</startTime> <endTime>{current-dateTime()}</endTime> <xmlFile>{$xml}</xmlFile> <xsdFile>{$xsd}</xsdFile> <xsdProcessor>BaseX {data(db:system()//version)}, EE-Java, {validate:xsd-processor()} 2.12.2</xsdProcessor> <xsdVersion>{validate:xsd-version()}</xsdVersion> </metadata> <messages>{$result/message}</messages> </root> It is emitting the following output: <root> <metadata> <result>invalid</result> <errors>3</errors> <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> <xmlFile>\\...\AForm-XSD-20211013\PD220224062681.XML <file://.../AForm-XSD-20211013/PD220224062681.XML%3c/xmlFile> </xmlFile> <xsdFile>\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd <file://.../AForm-XSD-20211013/Miami-ws-AForm.xsd%3c/xsdFile> </xsdFile> <xsdProcessor>BaseX 10.1, EE-Java, Xerces 2.12.2</xsdProcessor> <xsdVersion>1.1</xsdVersion> </metadata> <messages> ... </messages> </root> The question is why the before and after timing is the same: <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> They are identical up to a millisecond. My expectations were that at least the millisecond time portion would be different. Regards, Yitzhak Khabinsky
Y
ykhabinsin reply to Lizzi, Vincent, 9 Sep 2022, 19:549 Sep 2022 23:14 #
Hi Vincent, Thanks. I am all set. Regards, Yitzhak Khabinsky
Quoted text · Lizzi, Vincent · 120 lines
From: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> Sent: Friday, September 9, 2022 1:55 PM To: ykhabins at bellsouth.net; 'BaseX' <basex-talk at mailman.uni-konstanz.de> Subject: RE: [basex-talk] current-dateTime() function precision Hi Yitzhak The adjust-dateTime-to-timezone function may do what you need. For example, this converts the current time to UTC. adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration('PT0H')) For EDT, change the duration to "-PT4H". The duration that is needed for US Eastern time will vary depending on the time of year. See https://maxtoroq.github.io/xpath-ref/fn/adjust-dateTime-to-timezone.html Kind regards, Vincent Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group <mailto:vincent.lizzi at taylorandfrancis.com> vincent.lizzi at taylorandfrancis.com Information Classification: General From: ykhabins at bellsouth.net <mailto:ykhabins at bellsouth.net> <ykhabins at bellsouth.net <mailto:ykhabins at bellsouth.net> > Sent: Friday, September 9, 2022 1:46 PM To: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com <mailto:Vincent.Lizzi at taylorandfrancis.com> >; 'BaseX' <basex-talk at mailman.uni-konstanz.de <mailto:basex-talk at mailman.uni-konstanz.de> > Subject: RE: [basex-talk] current-dateTime() function precision Hi Vincent and Martin, Thanks for the clarification. I switched to using the Profiling module. let $before_datetime := convert:integer-to-dateTime(prof:current-ms()) (: current-dateTime() :) And it is working well. <startTime>2022-09-09T17:31:34.466Z</startTime> <endTime>2022-09-09T17:31:34.538Z</endTime> The last remaining task is to convert the output from the UTC time zone to my local EST: <startTime>2022-09-09T13:31:34.466-04:00</startTime> Any idea how to achieve that? Regards, Yitzhak Khabinsky From: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com <mailto:Vincent.Lizzi at taylorandfrancis.com> > Sent: Friday, September 9, 2022 1:26 PM To: ykhabins at bellsouth.net <mailto:ykhabins at bellsouth.net> ; 'BaseX' <basex-talk at mailman.uni-konstanz.de <mailto:basex-talk at mailman.uni-konstanz.de> > Subject: RE: [basex-talk] current-dateTime() function precision Hello Yitzhak, The current-dateTime() function returns the same value throughout the execution of a single query. The Profiling module has functions that provide the current system time, which is probably more to what you need. https://docs.basex.org/wiki/Profiling_Module Kind regards, Vincent Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group <mailto:vincent.lizzi at taylorandfrancis.com> vincent.lizzi at taylorandfrancis.com Information Classification: General From: BaseX-Talk <basex-talk-bounces at mailman.uni-konstanz.de <mailto:basex-talk-bounces at mailman.uni-konstanz.de> > On Behalf Of ykhabins at bellsouth.net <mailto:ykhabins at bellsouth.net> Sent: Friday, September 9, 2022 11:55 AM To: 'BaseX' <basex-talk at mailman.uni-konstanz.de <mailto:basex-talk at mailman.uni-konstanz.de> > Subject: [basex-talk] current-dateTime() function precision Hello, I am using BaseX v.10.1 It seems that the current-dateTime() function precision is off. I am validating an XML file against an XSD 1.1 file via Xerces 2.12.2 validator. And trying to measure a timing of it. Here is my code. xquery version "4.0"; let $xml := '\\...\AForm-XSD-20211013\PD220224062681.XML' let $xsd := '\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd' let $before_datetime := current-dateTime() let $result := validate:xsd-report($xml, $xsd, map { 'http://apache.org/xml/features/validation/cta-full-xpath-checking': true() }) return <root><metadata> <result>{data($result/status)}</result> <errors>{count($result/message)}</errors> <startTime>{$before_datetime}</startTime> <endTime>{current-dateTime()}</endTime> <xmlFile>{$xml}</xmlFile> <xsdFile>{$xsd}</xsdFile> <xsdProcessor>BaseX {data(db:system()//version)}, EE-Java, {validate:xsd-processor()} 2.12.2</xsdProcessor> <xsdVersion>{validate:xsd-version()}</xsdVersion> </metadata> <messages>{$result/message}</messages> </root> It is emitting the following output: <root> <metadata> <result>invalid</result> <errors>3</errors> <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> <xmlFile>\\...\AForm-XSD-20211013\PD220224062681.XML <file://.../AForm-XSD-20211013/PD220224062681.XML%3c/xmlFile> </xmlFile> <xsdFile>\\...\AForm-XSD-20211013\Miami-ws-AForm.xsd <file://.../AForm-XSD-20211013/Miami-ws-AForm.xsd%3c/xsdFile> </xsdFile> <xsdProcessor>BaseX 10.1, EE-Java, Xerces 2.12.2</xsdProcessor> <xsdVersion>1.1</xsdVersion> </metadata> <messages> ... </messages> </root> The question is why the before and after timing is the same: <startTime>2022-09-09T11:32:29.667-04:00</startTime> <endTime>2022-09-09T11:32:29.667-04:00</endTime> They are identical up to a millisecond. My expectations were that at least the millisecond time portion would be different. Regards, Yitzhak Khabinsky

⚡Generated with XQuery