diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-05 17:57:21 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-05 17:57:21 +0800 |
commit | d74ae1e8f983520c4fa0322daeedc9bcc9304710 (patch) | |
tree | 3a04ff9fc8b8b5fee6704e695d132a7cc3f4efb0 /common/sys/time.c | |
parent | b31a0e3d53ce17d4626fe125dd1e1f654a0d192c (diff) | |
download | pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.gz pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.bz2 pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.lz pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.xz pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.zst pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.zip |
- (internal) replace all localtime4() by localtime4_r().
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4272 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'common/sys/time.c')
-rw-r--r-- | common/sys/time.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/sys/time.c b/common/sys/time.c index 7a3768c1..3031d445 100644 --- a/common/sys/time.c +++ b/common/sys/time.c @@ -79,6 +79,20 @@ Cdatedate(const time4_t * clock) } /** + * 5+1 bytes, "12/31\0" + */ +const char* +Cdate_md(const time4_t * clock) +{ + time_t temp = (time_t)*clock; + struct tm mytm; + + localtime_r(&temp, &mytm); + strftime(cdate_buffer, sizeof(cdate_buffer), "%m/%d", &mytm); + return cdate_buffer; +} + +/** * 11+1 bytes, "12/31 10:01\0" */ const char* |