This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How stored date and time information?

On STM32F1 I need create a log with storing the EEPROM, any as

30.10.2015 17:30 temp, humidity, xx, xx ,xx
30.10.2015 17:45 temp, humidity, xx, xx ,xx

I wonder how to store time information?
I do not use Linux int32 (time_t) since 2038 is next door.

You can recommend a standardized format for storing time information in EEPROM?

Parents
  • As Per points out 32-bit 1970 Epoch numbers go out to 2106, many RTC implementation just deal with 1901 thru 2099 as it simplifies the leap year logic.

    Windows has a 64-bit format

    Doing calendering from any epoch isn't that complicated, though a lot of people do screw it up, and don't test their code, so you should always verify the corner cases on stuff you pick up off the internets.

    The 2038 thing is a bit of a red herring, sure some old crap is going to fail, but anyone putting any thought into things will be fine.

Reply
  • As Per points out 32-bit 1970 Epoch numbers go out to 2106, many RTC implementation just deal with 1901 thru 2099 as it simplifies the leap year logic.

    Windows has a 64-bit format

    Doing calendering from any epoch isn't that complicated, though a lot of people do screw it up, and don't test their code, so you should always verify the corner cases on stuff you pick up off the internets.

    The 2038 thing is a bit of a red herring, sure some old crap is going to fail, but anyone putting any thought into things will be fine.

Children