xref: /reactos/sdk/lib/crt/time/time.c (revision 50cf16b3)
1 /*
2  * COPYRIGHT:   LGPL, See LGPL.txt in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/sdk/crt/time/time.c
5  * PURPOSE:     Implementation of _time (_time32, _time64)
6  * PROGRAMER:   Timo Kreuzer
7  */
8 #include <precomp.h>
9 #include <time.h>
10 #include "bitsfixup.h"
11 
12 time_t _time(time_t* ptime)
13 {
14     FILETIME SystemTime;
15     time_t time = 0;
16 
17     GetSystemTimeAsFileTime(&SystemTime);
18     time = (time_t)FileTimeToUnixTime(&SystemTime, NULL);
19 
20     if (ptime)
21     {
22         *ptime = time;
23     }
24     return time;
25 }
26