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

    Date Time convert to Microsoft Access

    Scheduled Pinned Locked Moved WiPy 2&3
    timelopywipy
    5 Posts 3 Posters 56 Views 3 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.
    • W Offline
      Wolli01
      last edited by Wolli01

      How do I get for example this date/time (06.11.2000 03:00:00)
      in Micropython so converted
      Microsoft Access, date/time (36836,125)
      Does anyone know how this works?
      I would be very grateful for your cooperation.

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

        Not really sure what it is you want to do?

        If you want timestamps you can use the RTC:
        https://docs.pycom.io/firmwareapi/pycom/machine/rtc/#app

        If you want it on another format, you can use the datetime library from micropython-libraries-master, where there is a isoformat() method to convert to ISO / UTC timestamp.

        W 1 Reply Last reply Reply Quote 0
        • J Offline
          jcaron @Wolli01
          last edited by

          @Wolli01 Microsoft access date/time is the number of days since December 30, 1899.

          So you can:

          • Parse the various fields of your date (day, month, year, hours, minutes, seconds)
          • Use utime.mktime to convert that to a timestamp (seconds since 1/1/1970)
          • Divide by 86400 (seconds in a day)
          • Add the right offset (the number of days between 30/12/1899 and 1/1/1970)
          W 1 Reply Last reply Reply Quote 0
          • W Offline
            Wolli01 @jcaron
            last edited by

            @jcaron thank you

            1 Reply Last reply Reply Quote 0
            • W Offline
              Wolli01 @railmonitor
              last edited by

              @railmonitor thank you

              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