Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.3 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991-1993 Microsoft Corporation
  3. Module Name:
  4. timelib.h
  5. Abstract:
  6. Include file for netlib time routines
  7. Author:
  8. Dan Hinsley (danhi) 8-Jun-1991
  9. Environment:
  10. User Mode - Win32
  11. Portable to any flat, 32-bit environment. (Uses Win32 typedefs.)
  12. Requires ANSI C extensions: slash-slash comments.
  13. Revision History:
  14. 29-Aug-1991 beng
  15. Renamed to "netlib0.h" to avoid collision with net\inc\netlib.h
  16. 29-Oct-1991 danhi
  17. Moved from net\netcmd\map32\netlib0.h
  18. 16-Aug-1992 JohnRo
  19. RAID 2920: Support UTC timezone in net code.
  20. 01-Oct-1992 JohnRo
  21. RAID 3556: Added NetpSystemTimeToGmtTime() for DosPrint APIs.
  22. 10-Jun-1993 JohnRo
  23. RAID 13080: Allow repl between different timezones.
  24. --*/
  25. #ifndef _TIMELIB_
  26. #define _TIMELIB_
  27. #ifdef NT_INCLUDED
  28. #include <nturtl.h>
  29. #endif
  30. #include <time.h>
  31. #include <winbase.h> // LPSYSTEMTIME.
  32. #include <lmcons.h> // NET_API_STATUS.
  33. int net_gmtime(time_t * timp, struct tm *tb);
  34. DWORD time_now(VOID);
  35. #define MAX_DATE_TIME_LEN 128
  36. VOID
  37. NetpGmtTimeToLocalTime(
  38. IN DWORD GmtTime, // seconds since 1970 (GMT), or 0, or -1.
  39. OUT LPDWORD LocalTime // seconds since 1970 (local), or, or -1.
  40. );
  41. VOID
  42. NetpLocalTimeToGmtTime(
  43. IN DWORD LocalTime, // seconds since 1970 (local), or 0, or -1.
  44. OUT LPDWORD GmtTime // seconds since 1970 (GMT), or 0, or -1.
  45. );
  46. LONG
  47. NetpLocalTimeZoneOffset(
  48. VOID
  49. );
  50. NET_API_STATUS
  51. NetpSystemTimeToGmtTime(
  52. IN LPSYSTEMTIME TimeStructure,
  53. OUT LPDWORD GmtTime // seconds since 1970 (GMT).
  54. );
  55. //
  56. // Functions for getting the user - specific time format.
  57. //
  58. #define MAX_TIME_SIZE 80
  59. typedef struct _NET_TIME_FORMAT {
  60. LPSTR AMString; // May be NULL if we couldn't allocate
  61. LPSTR PMString; // May be NULL if we couldn't allocate
  62. BOOL TwelveHour;
  63. BOOL TimePrefix; // For new time prefix
  64. BOOL LeadingZero;
  65. LPSTR DateFormat; // May be NULL if we couldn't allocate
  66. LPSTR TimeSeparator; // May be NULL if we couldn't allocate
  67. } NET_TIME_FORMAT, *LPNET_TIME_FORMAT;
  68. VOID
  69. NetpGetTimeFormat(
  70. LPNET_TIME_FORMAT TimeFormat
  71. );
  72. #endif // _TIMELIB_