2009-01-19 22:05:27 +00:00
|
|
|
/*
|
2009-08-06 11:01:44 +00:00
|
|
|
* COPYRIGHT: LGPL, See LGPL.txt in the top level directory
|
2009-01-19 22:05:27 +00:00
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* FILE: lib/sdk/crt/time/time.c
|
2010-07-10 21:39:55 +00:00
|
|
|
* PURPOSE: Implementation of _time (_time32, _time64)
|
2009-01-19 22:05:27 +00:00
|
|
|
* PROGRAMER: Timo Kreuzer
|
|
|
|
*/
|
|
|
|
#include <precomp.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include "bitsfixup.h"
|
|
|
|
|
|
|
|
time_t _time(time_t* ptime)
|
|
|
|
{
|
2009-08-08 11:40:48 +00:00
|
|
|
FILETIME SystemTime;
|
|
|
|
time_t time = 0;
|
|
|
|
|
|
|
|
GetSystemTimeAsFileTime(&SystemTime);
|
2011-09-15 17:11:53 +00:00
|
|
|
time = (time_t)FileTimeToUnixTime(&SystemTime, NULL);
|
2009-01-19 22:05:27 +00:00
|
|
|
|
|
|
|
if (ptime)
|
|
|
|
{
|
2009-08-08 11:40:48 +00:00
|
|
|
*ptime = time;
|
2009-01-19 22:05:27 +00:00
|
|
|
}
|
2009-08-08 11:40:48 +00:00
|
|
|
return time;
|
2009-01-19 22:05:27 +00:00
|
|
|
}
|