Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Wrong dates on files saved to SD card

    Scheduled Pinned Locked Moved MicroPython
    4 Posts 2 Posters 56 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      railmonitor
      last edited by railmonitor

      Hi.

      Was wondering if anyone had a explanation for, why the dates of files i create and write to on my FiPy is showing wrong dates?

      I have a program that samples from a sensor, and saves the data to a file on my SD card when done sampling.

      I just noticed, when i inserted my SD card into my laptop, that the dates of the files (last modified), is totally wrong, showing me dates from the 31st of december 1999 and up to 1st of january 2000... For files that were created and written to on the 4th of june!

      I seems that the filesystem is using an "epoch" date of 1st of january 2000. But how can i happen that it's giving me dates from newyearseve 1999?

      Naturally i assumed that since i did not sync the RTC prior to writing in the file, it was giving me these old dates. So i then synced the RTC, and made sure that it gives me a correct timestamp when calling rtc.now().

      But the file now says, that it was last modified in 2050 (the time of day is however correct)?

      c1d40837-91d3-475e-8485-6f98d489dbc8-image.png

      It looks like a bug to me?

      robert-hhR 2 Replies Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @railmonitor
        last edited by

        @railmonitor May I ask for the firmware version you are using?

        1 Reply Last reply Reply Quote 0
        • R Offline
          railmonitor
          last edited by railmonitor

          @robert-hh Yes:
          (sysname='FiPy', nodename='FiPy', release='1.20.2.rc6', version='v1.11-01f49f7 on 2020-02-28', machine='FiPy with ESP32', lorawan='1.0.2', sigfox='1.0.1', pybytes='1.3.1')

          Used with a Pysense board!

          1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @railmonitor
            last edited by

            @railmonitor said in Wrong dates on files saved to SD card:

            I seems that the filesystem is using an "epoch" date of 1st of january 2000. But how can i happen that it's giving me dates from newyearseve 1999?

            MicroPython does not care for timezones. It always assumes UTC. Since you PC does know timezones, there can be differences of a few hours. And unless you set the time of your FiPy properly, the time stamp value will start January 1st, 2000 on every boot.
            The Linux epoch time is January 1st, 1970. That may cause the 30 years difference. So it looks like the compensation for the epoch times difference is applied twice.
            May I ask you to raise an issue. That ensures that this glitch does not get lost and will eventually be fixed.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom