DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Date and Time channels in Diadem files

I'm developing a tool to convert data files from or own format to Diadem data files format, producing a header (.dat) and a binary file (.r64).
From my source data files, I have to convert a date channel and a time channel. Is there a way to store such channels in binary format (in the .r64 file) ?
I got the GFS's pdf "Description of the Data formats and File set properties", but I didn't find any info about binary date or time channels.
Thanks for help.
0 Kudos
Message 1 of 5
(7,312 Views)
Hello Michel,

This is not an easy question to answer without knowing more specific information about your data file.

I'll try and give you some ideas though. DIAdem stores the date and time data in ONE channel, not separately. It basically counts the number of seconds from a certain 'year 0' and, using leap years etc. determines the current date and time. So what you will have to do is load your date and time channel and save them as one channel in order to make it a DIAdem time channel.

Ideally, you only need to create a *.DAT file for your binary files to import them into DIAdem.

If you can, please provide a file and a description of your binary format and I will see what I can do with it to turn it into a DIAdem data file.

Otmar
Otmar D. Foehner
Message 2 of 5
(7,312 Views)
Hi Otmar,
Thank you for your valuable answer!

I just need to find the starting point (the year 0). Is the date/time value stored as integer or is the fractional part of the float used also?

It's not easy to provide sample files, we use different binary formats. But when my converter writes the Diadem file, it holds the date and time as a variant (VT_DATE). So it is implemented using an 8-byte floating-point number. Days are represented by whole number increments starting with 30 December 1899, midnight as time zero. Time is expressed in seconds as the absolute value of the fractional part of the number.
Michel
0 Kudos
Message 3 of 5
(7,312 Views)
Michel,

The starting point is 01.01.0000 at 00:00:00. This time/date is the value '0'. The DIAdem time channels will be accurate until at least 12/31/2078, starting at 10/15/1582. This is due to changes made to the Gregorian calendar made back in 1582 concerning leap years.

Today (04/18/2202) at 1:00:00 PM (13:00:00 military time) would be the value 6.31862676E+10. This number represents the number of seconds that have passed since 01.01.0000 at 00:00:00.

DIAdem provides two functions to convert numbers into time data and time data into numerical data. They are TTR (time to real) and RTT (real to time). The DIAdem help system contains additional information on how to use these functions.

Let me know if there is any additional information I ca
n help you with.

Otmar
Otmar D. Foehner
0 Kudos
Message 4 of 5
(7,312 Views)

Help should provide link to RTT by TTR description. It is really hard to find it without google.

0 Kudos
Message 5 of 5
(5,226 Views)