Date Time convert to Microsoft Access
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.
@railmonitor thank you
@jcaron thank you
@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)
utime.mktimeto 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)
Not really sure what it is you want to do?
If you want timestamps you can use the RTC:
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.