I assume these are durations, but I’m not sure if the clock start date is relevant. If you can assume it’s not going to span days, my first thought was something like:
string(xs:time("00:00:00.000") + xs:dayTimeDuration("PT0.0001S")) which produces: 00:00:00.0001 The duration is being expressed as an arbitrary number of seconds. “PT0.0001S” is 1 microsecond, I think. The duration added to a time results in a time and the default format is what you asked for. Another example: string(xs:time("00:00:00.000") + xs:dayTimeDuration("PT9999999.9999S")) is: On 8/29/17, 12:51 PM, "basex-talk-boun...@mailman.uni-konstanz.de on behalf of Dave Day" <basex-talk-boun...@mailman.uni-konstanz.de on behalf of david....@duke-software.com> wrote: Greetings List, I've got an 8 byte value that is the output of a Store Clock instruction on a mainframe. The value created by the instruction is a 64 bit hex value where bit 51 is equal to one microsecond. To get a value that is microseconds, the original clock value is shifted to the right 12 bits. The clock started at all 0's on January 1st, 1900. I need to be able to store and do basic math(addition and subtraction) on the value in microseconds. And, these values will need to be displayed on a browser in HH:MM:SS.TTTTTT format. If I create the decimal value for the integer on the mainframe when creating the XML record, I will have to go thru some conversion logic. There could be possibly millions of these records in one XML database. It seems to me to make more sense to create the value as a hexBinary element, and then have some code running within BaseX do the conversion to create the correct time value. Is this the way to do something like this? Regards, -- Dave Day