AnsweredAssumed Answered

MQX "struct tm" not standard C

Question asked by Hugo Bouchard on Oct 19, 2016
Latest reply on Apr 6, 2017 by Adrian Rockall

Hello,

 

When a look at the definition of the struct tm in mqx.h I see that it is a little different then standard C. Here is the definition in mqx.h:

 

struct tm {

 

    /*! \brief Range from 0 to 59. */
    int32_t         tm_sec;

 

    /*! \brief Range from 0 to 59. */
    int32_t         tm_min;

 

    /*! \brief Range from 0 to 23. */
    int32_t         tm_hour;

 

    /*! \brief Range from 0 to 30, depend on month. */
    int32_t         tm_mday;

 

    /*! \brief Range from 0 to 11. */
    int32_t         tm_mon;

 

    /*! \brief Range from 0, since 1900. */
    int32_t         tm_year;

 

    /*! \brief Range from 0 to 6. */
    int32_t         tm_wday;

 

    /*! \brief Range from 0 to 365. */
    int32_t         tm_yday;

 

    /*! \brief A flag that indicates whether daylight saving
    *  time is in effect at the time described
    */
    int32_t         tm_isdst;
};

 

As you can see, tm_mday is ranged from 0 to 30. According to C standard, tm_mday should be ranged from 1 to 31.

 

Is this normal?

Outcomes