In ArcMap I have a table with a column with the date type yyyy-mm-dd, but after opening SQlite in QGIS, this column is written as a double type.

How do I convert data in the form of a number to a date in QGIS?

  • How does the value in the field look like? If blank, the data is probably lost. If something like 0.00000, you may have a chance to retrieve them. Either Refactor tool or to_date() function in the field calculator would worth a try. – Kazuhito Mar 4 '18 at 12:10
  • Have a read of sqlitetutorial.net/sqlite-date in particular the section of Real storage of date types, apparently the storage is days since noon in Greenwich on November 24, 4714 B.C. with the fraction portion being the time as a decimal of 24 hours whereas python packed time is docs.python.org/3/library/time.html#time.time January 1, 1970, 00:00:00 (UTC) so it's not just a straight conversion. It might be better to do this in SQLLite using any one of the functions mentioned in sqlite.org/lang_datefunc.html – Michael Stimson Mar 5 '18 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.