constellation icon indicating copy to clipboard operation
constellation copied to clipboard

EPOCH values in Consty are in milliseconds and not seconds

Open GammaVel opened this issue 2 years ago • 0 comments

Prerequisites

  • [X] Put an X between the brackets on this line if you have done all of the following:

    • Running the latest version of Constellation

    • Attached the Support Package via Help > Support Package

    • Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ

    • Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues

    • Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories

Description

I've been importing data into Constellation based on EPOCH times. I noticed that Constellation was showing the current EPOCH time in 1970, which didn't seem right. After some investigation it became clear that Constellation is using milliseconds and not seconds when formatting EPOCH time fields.

Based on some research, it looks like the standard for EPOCH is seconds past 1970:

From: https://www.epochconverter.com/ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).

With Constellation using milliseconds, it means I need to do an extra calculation on the EPOCH time to covert it to milliseconds before it can be used in the import.

Steps to Reproduce

  1. Create a sample CSV file for testing that has EPOCH times
  2. Import into Constellation using Import from file functionality
  3. In Constellation observe the values are correct and match the file
  4. Apply the date time formatter of EPOCH for the date time attribute
  5. Drag over the EPOCH column
  6. Observe the time that is displayed.
  7. Compare to an EPOCH convertor - they don't match

Next, update the file to add a thousand (milliseconds) 000 to each of the values 8. Repeat import process 9. Now the date and times are matching online as expected 10. This shows that milliseconds are being used by Constellation

Expected behaviour: This is up to review if Constellation should follow the standards or keep using milliseconds

Actual behaviour: see test steps

Reproduces how often: 100%

Additional Information

image

Converted to milliseconds: image

GammaVel avatar Jul 14 '22 05:07 GammaVel