1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/time.c
Owen Dunn 06434ffc71 New function ltime() returns a struct tm of the current local time.
Fixes crashes when time() returns (time_t)-1 on Windows by using the
Win32 GetLocalTime() function.  (The Unix implementation still just 
uses time() and localtime().)

[originally from svn r5086]
2005-01-09 14:27:48 +00:00

11 lines
152 B
C

#include <time.h>
#include <assert.h>
struct tm ltime(void)
{
time_t t;
time(&t);
assert (t != ((time_t)-1));
return *localtime(&t);
}