Common utility and helper functions.
This group defines a set of common support and helper functions.
|
LCB_Func long LCB_CALL | LCB_GetCurrentTime (unsigned long *pTime) |
| Returns the current local system time as a C like time type. More...
|
|
LCB_Func long LCB_CALL | LCB_MakeTime (unsigned short Year, unsigned char Month, unsigned short Day, unsigned char Hour, unsigned char Minute, unsigned char Second, unsigned long *pTime) |
| Converts splitted time parameters into a C like time value. More...
|
|
LCB_Func long LCB_CALL | LCB_SplitTime (unsigned long Time, unsigned short *pYear, unsigned char *pMonth, unsigned short *pDay, unsigned char *pHour, unsigned char *pMinute, unsigned char *pSecond) |
| Splits a time value into its single components. More...
|
|
LCB_Func long LCB_CALL | LCB_TimeToStr (unsigned long Time, char *pTimeStrBuf, unsigned char BufSize) |
| Converts a time value into a string YYYY-MM-DD HH:mm:ss. More...
|
|
◆ LCB_GetCurrentTime()
LCB_Func long LCB_CALL LCB_GetCurrentTime |
( |
unsigned long * |
pTime | ) |
|
Returns the current local system time as a C like time type.
- Parameters
-
[out] | pTime | The current local system time |
- Returns
- Error code - ERR_NOERR indicates success
◆ LCB_MakeTime()
LCB_Func long LCB_CALL LCB_MakeTime |
( |
unsigned short |
Year, |
|
|
unsigned char |
Month, |
|
|
unsigned short |
Day, |
|
|
unsigned char |
Hour, |
|
|
unsigned char |
Minute, |
|
|
unsigned char |
Second, |
|
|
unsigned long * |
pTime |
|
) |
| |
Converts splitted time parameters into a C like time value.
- Parameters
-
[in] | Year | Year i.e. 2009 |
[in] | Month | The month from 1 - 12 |
[in] | Day | Day of month from 1 - 31 |
[in] | Hour | Hour of day 0 - 23 |
[in] | Minute | Minute of hour from 0 - 59 |
[in] | Second | Second of minute from 0 - 59 |
[out] | pTime | Returns converted time value |
- Note
- Some functions require a time value. You can create this time value by calling this function
- Returns
- Error code - ERR_NOERR indicates success
◆ LCB_SplitTime()
LCB_Func long LCB_CALL LCB_SplitTime |
( |
unsigned long |
Time, |
|
|
unsigned short * |
pYear, |
|
|
unsigned char * |
pMonth, |
|
|
unsigned short * |
pDay, |
|
|
unsigned char * |
pHour, |
|
|
unsigned char * |
pMinute, |
|
|
unsigned char * |
pSecond |
|
) |
| |
Splits a time value into its single components.
- Parameters
-
[in] | Time | The time value to be converted |
[out] | pYear | Year i.e. 2009 |
[out] | pMonth | The month from 1 - 12 |
[out] | pDay | Day of month from 1 - 31 |
[out] | pHour | Hour of day 0 - 23 |
[out] | pMinute | Minute of hour from 0 - 59 |
[out] | pSecond | Second of minute from 0 - 59 |
- Note
- Some functions retrun a time value. You can split this value into single components with this function
- Returns
- Error code - ERR_NOERR indicates success
◆ LCB_TimeToStr()
LCB_Func long LCB_CALL LCB_TimeToStr |
( |
unsigned long |
Time, |
|
|
char * |
pTimeStrBuf, |
|
|
unsigned char |
BufSize |
|
) |
| |
Converts a time value into a string YYYY-MM-DD HH:mm:ss.
- Parameters
-
- See also
- LCB_GetCurrentTime()
- Parameters
-
[out] | pTimeStrBuf | Time string buffer stores time string |
[in] | BufSize | Size of string buffer |
- Returns
- Error code - ERR_NOERR indicates success