Changes between Version 6 and Version 7 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/Time/GetTimeStr
- Timestamp:
- 01/29/21 09:22:33 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/Time/GetTimeStr
v6 v7 6 6 7 7 char* GetTimeStr(char* pszBuffer, int secs); 8 9 string GetTimeStr(datetime_struct* pTime, int secs; 10 11 char* GetTimeStr(datetime_struct* pTime, char* pszBuffer, int secs); 8 12 }}} 9 13 … … 12 16 * secs - 0 = format time without secs, 1 = include seconds 13 17 * pszBuffer - buffer to hold formatted time, application programmer must insure that this buffer is large enough for the time. 18 * pTime - pointer to datetime_struct to format the time from instead of current time. 14 19 15 20 == Return Value == 16 21 17 * Returns the time formatted as "HH:MM:SS" or "HH-MM-SS", or "HH:MM x.m.", based on boot loader preferences. Application developers should consider that time string will be longer if preferences are set for 12 hour time. 22 * Returns the time formatted as "HH:MM:SS" or "HH-MM-SS", or "HH:MM x.m.", based on boot loader preferences. Application developers should consider that time string will be longer if preferences are set for 12 hour time. The versions of the function that take a pointer to a datetime_struct allow a string to be formatted from an arbitrary time. 18 23 19 24 == Remarks == … … 34 39 }}} 35 40 41 {{{ 42 datetime_struct dt; 43 dt.hour = 9; 44 dt.minute = 21; 45 dt.second = 30; 46 47 string strTime = GetTimeStr(&dt, 1); 48 DisplayText(10, 10, strTime); 49 }}} 50 51 {{{ 52 datetime_struct dt; 53 dt.hour = 9; 54 dt.minute = 21; 55 dt.second = 30; 56 57 char szTime[20]; 58 59 GetTimeStr(&dt, szTime, 1); 60 DisplayText(10, 10, szTime); 61 }}} 62 36 63 == See Also == 37 64