source: filezilla/trunk/fuentes/src/putty/windows/wintime.c @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 537 bytes
Line 
1/*
2 * wintime.c - Avoid trouble with time() returning (time_t)-1 on Windows.
3 */
4
5#include "putty.h"
6#include <time.h>
7
8struct tm ltime(void)
9{
10    SYSTEMTIME st;
11    struct tm tm;
12
13    GetLocalTime(&st);
14    tm.tm_sec=st.wSecond;
15    tm.tm_min=st.wMinute;
16    tm.tm_hour=st.wHour;
17    tm.tm_mday=st.wDay;
18    tm.tm_mon=st.wMonth-1;
19    tm.tm_year=(st.wYear>=1900?st.wYear-1900:0);
20    tm.tm_wday=st.wDayOfWeek;
21    tm.tm_yday=-1; /* GetLocalTime doesn't tell us */
22    tm.tm_isdst=0; /* GetLocalTime doesn't tell us */
23    return tm;
24}
Note: See TracBrowser for help on using the repository browser.