Hi Kevin!

On Tue, Nov 08, 2016 at 09:37:18AM +0100, Kevin Townsend wrote:
> Would it make sense to add support to datetime.c/h to convert to and from
> ISO8601 timestamps, which are much more convenient to display since you can
> use a struct like this to print the values directly in the shell, etc.:
> 
>    typedef struct ATTR_PACKED
>    {
>         char year[4];        /**< Year         */
>         char dash1;          /**< Dash1        */
>         char month[2];       /**< Month        */
>         char dash2;          /**< Dash2        */
>         char day[2];         /**< Day          */
>         char T;              /**< T            */
>         char hour[2];        /**< Hour         */
>         char colon1;         /**< Colon1       */
>         char minute[2];      /**< Minute       */
>         char colon2;         /**< Colon2       */
>         char second[2];      /**< Second       */
>         char decimal;        /**< Decimal      */
>         char sub_second[6];  /**< Sub-second   */
>         char Z;              /**< UTC timezone */
> 
>         char nullterm;       // not part of the format, make printf easier
>    } iso8601_time_t;
> 
<snip>
>
> Just curious if this adds enough value to be included or if epoch is
> generally preferable as the sole time keeping units in the core codebase.

Just my 2 cents:
IMO it seems not advisable to "waste" 28 bytes (if I counted correctly) for a
simple 32 bit timestamp on a memory constrained device. I would always
outsource this type of convenience operations to backend tools. Even for
debugging this seems to be kind of huge.

Cheers,
Oleg
-- 
panic("Unable to find empty mailbox for aha1542.\n");
        linux-2.2.16/drivers/scsi/aha1542.c

Attachment: signature.asc
Description: PGP signature

Reply via email to