Botan  1.10.9
time.h
Go to the documentation of this file.
1 /*
2 * Time Functions
3 * (C) 1999-2009 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_TIME_H__
9 #define BOTAN_TIME_H__
10 
11 #include <botan/types.h>
12 
13 namespace Botan {
14 
15 /**
16 * Struct representing a particular date and time
17 */
18 struct BOTAN_DLL calendar_point
19  {
20  /** The year */
22 
23  /** The month, 1 through 12 for Jan to Dec */
25 
26  /** The day of the month, 1 through 31 (or 28 or 30 based on month */
28 
29  /** Hour in 24-hour form, 0 to 23 */
31 
32  /** Minutes in the hour, 0 to 60 */
34 
35  /** Seconds in the minute, 0 to 60, but might be slightly
36  larger to deal with leap seconds on some systems
37  */
39 
40  /**
41  * Initialize a calendar_point
42  * @param y the year
43  * @param mon the month
44  * @param d the day
45  * @param h the hour
46  * @param min the minute
47  * @param sec the second
48  */
49  calendar_point(u32bit y, byte mon, byte d, byte h, byte min, byte sec) :
50  year(y), month(mon), day(d), hour(h), minutes(min), seconds(sec) {}
51  };
52 
53 /**
54 * @param time_point a time point from the system clock
55 * @return calendar_point object representing this time point
56 */
57 BOTAN_DLL calendar_point calendar_value(u64bit time_point);
58 
59 /**
60 * @return seconds resolution timestamp, unknown epoch
61 */
62 BOTAN_DLL u64bit system_time();
63 
64 /**
65 * @return nanoseconds resolution timestamp, unknown epoch
66 */
67 BOTAN_DLL u64bit get_nanoseconds_clock();
68 
69 }
70 
71 #endif
u64bit get_nanoseconds_clock()
Definition: time.cpp:93
calendar_point calendar_value(u64bit a_time_t)
Definition: time.cpp:81
unsigned char byte
Definition: types.h:22
unsigned long long u64bit
Definition: types.h:49
u64bit system_time()
Definition: time.cpp:73
calendar_point(u32bit y, byte mon, byte d, byte h, byte min, byte sec)
Definition: time.h:49
unsigned int u32bit
Definition: types.h:32