Skip to content

What Is the Correct Return of GetSelTime? #212

@hexiaodou

Description

@hexiaodou

Can someone help answer the following questions?
Does the sel time get (Command Code 0x48) in the ipmi Protocol Obtain the UTC Time or the localtime Including the Time Zone?
I can see from the code that the epoch time is obtained, but the local time is described in the ipmi2.0 specification.Which one is correct?

codes:
/** @brief implements the get SEL time command

  • @returns IPMI completion code plus response data
  • -current time
    */
    ipmi::RspType<uint32_t> // current time
    ipmiStorageGetSelTime()
    {
    ...
// Time is really long int but IPMI wants just uint32. This works okay until
// the number of seconds since 1970 overflows uint32 size.. Still a whole
// lot of time here to even think about that.

...
}

IPMI2.0:
31.11b Set SEL Time UTC Offset
This command initializes and retrieve a UTC offset (timezone) that is associated with the SEL Time (see the Set
SEL Time command). The offset is the number of minutes difference between the local time zone and Universal
Coordinated Time (UTC).
If you know what the UTC time is, you get local time by adding the offset to the UTC time. To get UTC time
from local time (SEL Time) you subtract the offset from the local time. For example, the offset for United States
Pacific Standard Time is -8 (minus 8) hours. If the UTC time were 10am (10:00 hours), then Pacific Standard
Time would be 2am (02:00 hours). The offset for Tokyo, Japan is +9 (plus 9), so if the UTC time were 10am, then
the Tokyo, Japan time would be 7pm (19:00 hours).
Note that the UTC offset varies with DAYLIGHT SAVINGS TIME. Therefore, if this is capability is used,
software may be required to ensure the offset gets updated appropriately

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions