(SOC - Test) Storage Only Commit
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
#ifndef COMPOUND_UTILS_H
|
||||
# define COMPOUND_UTILS_H
|
||||
|
||||
# include <time.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
# include <Compound/common.h>
|
||||
# include <Compound/const.h>
|
||||
|
||||
# define DATETIME_FORMAT "%a %d %b %X %Z %Y"
|
||||
|
||||
int Utils_CalcDigits(long long n);
|
||||
int Utils_CalcDateTimeLiteralisationLength(char *buff);
|
||||
|
||||
#endif /* COMPOUND_UTILS_H */
|
||||
|
@@ -14,3 +14,12 @@ int Utils_CalcDigits(long long n)
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
int Utils_CalcDateTimeLiteralisationLength(char *buff)
|
||||
{
|
||||
const time_t now = time(NULL);
|
||||
|
||||
(void)strftime(buff, 28, DATETIME_FORMAT, localtime(&now));
|
||||
|
||||
return strlen(buff);
|
||||
}
|
||||
|
Reference in New Issue
Block a user