Set the date and time components of this hzXDate using the epoch time (number of seconds since midnight , Jan 1 1970) Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hzXDate::SetByEpoch | (uint32_t,) |
Declared in file: hzDate.h
Defined in file : hzDate.cpp
Function Logic:
Function body:
void hzXDate::SetByEpoch (uint32_t nEpochTime)
{
// Set the date and time components of this hzXDate using the epoch time (number of seconds since midnight , Jan 1 1970)
//
// Arguments: 1) nEpochTime The date supplied as an epoch value
// Returns: None
struct tm* t ; // Converted system time
time_t pt ; // Time recepticle
uint32_t days ; // Used by date - no of days conversion
pt = nEpochTime ;
t = localtime(&pt) ;
_daysfromdate(days, t->tm_year + 1900,t->tm_mon+1,t->tm_mday);
m_hour = (days * 24)+t->tm_hour ;
m_usec = ((t->tm_min * 60)+t->tm_sec) * 1000000;
}