2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS CRT library
4 * FILE: lib/sdk/crt/time/ftime.c
5 * PURPOSE: Deprecated BSD library call
6 * PROGRAMERS: Timo Kreuzer
9 #include <sec_api/time_s.h>
10 #include <sys/timeb.h>
11 #include "bitsfixup.h"
13 /******************************************************************************
15 * \brief Get the current time.
16 * \param [out] ptimeb Pointer to a structure of type struct _timeb that
17 * recieves the current time.
18 * \sa http://msdn.microsoft.com/en-us/library/95e68951.aspx
21 _ftime_s(struct _timeb
*ptimeb
)
24 TIME_ZONE_INFORMATION TimeZoneInformation
;
27 /* Validate parameters */
38 ret
= GetTimeZoneInformation(&TimeZoneInformation
);
39 ptimeb
->dstflag
= (ret
== TIME_ZONE_ID_DAYLIGHT
) ? 1 : 0;
40 ptimeb
->timezone
= TimeZoneInformation
.Bias
;
42 GetSystemTimeAsFileTime(&SystemTime
);
43 ptimeb
->time
= FileTimeToUnixTime(&SystemTime
, &ptimeb
->millitm
);
48 /******************************************************************************
50 * \brief Get the current time.
51 * \param [out] ptimeb Pointer to a structure of type struct _timeb that
52 * recieves the current time.
53 * \note This function is for compatability and simply calls the secure
55 * \sa http://msdn.microsoft.com/en-us/library/z54t9z5f.aspx
58 _ftime(struct _timeb
*ptimeb
)