mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-12 04:13:28 +00:00
fix
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@804 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -32,5 +32,9 @@ void MwStringTime(char* out, time_t t) {
|
||||
struct tm* tm = localtime(&t);
|
||||
const char* months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
||||
|
||||
sprintf(out, "%s %2d %02d:%02d %d", months[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min, 1900 + tm->tm_year);
|
||||
if(tm == NULL) {
|
||||
sprintf(out, "localtime error");
|
||||
} else {
|
||||
sprintf(out, "%s %2d %02d:%02d %d", months[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min, 1900 + tm->tm_year);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user