Contains necessary classes and functions for ELEC351
Diff: loggingMaster/dateAndTime.cpp
- Revision:
- 1:4825c27dfbc9
- Parent:
- 0:f44c89c33601
- Child:
- 2:e2b885367ba8
--- a/loggingMaster/dateAndTime.cpp Sun Dec 24 21:36:31 2017 +0000 +++ b/loggingMaster/dateAndTime.cpp Sun Dec 24 21:50:10 2017 +0000 @@ -16,7 +16,7 @@ // Reasign date components to custom data type this-> date_time.day = tempTimeInfo->tm_mday; - this-> date_time.mnt = 1+tempTimeInfo->tm_mon; // Months indexed at 1 + this-> date_time.mnt = 1+tempTimeInfo->tm_mon; // Months indexed at 1 this-> date_time.yr = 1900 + tempTimeInfo->tm_year; // Years since epoch return date_time; // Return custom data type containing Date & Time @@ -48,9 +48,9 @@ time(&secondsElapsed); // Get time is seconds since epoch. tempTimeInfo = localtime (&secondsElapsed); // Convert current epoch time to calendar time acounting for timezones & daylight saving - tempTimeInfo->tm_mday = day; // Update day - tempTimeInfo->tm_mon = mnt - 1; // Update month / Indexed at 0 - tempTimeInfo->tm_year = yr - 1900 ; // Update year / Years since epoch + tempTimeInfo->tm_mday = day; // Update day + tempTimeInfo->tm_mon = mnt - 1; // Update month / Indexed at 0 + tempTimeInfo->tm_year = yr - 1900 ; // Update year / Years since epoch secondsElapsed = mktime(tempTimeInfo); // Convert to epoch time set_time(secondsElapsed); // Update RTC