Botan 1.10.17
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
13namespace Botan {
14
15/**
16* Struct representing a particular date and time
17*/
18struct BOTAN_DLL calendar_point
19 {
20 /** The year */
22
23 /** The month, 1 through 12 for Jan to Dec */
24 byte month;
25
26 /** The day of the month, 1 through 31 (or 28 or 30 based on month */
27 byte day;
28
29 /** Hour in 24-hour form, 0 to 23 */
30 byte hour;
31
32 /** Minutes in the hour, 0 to 60 */
33 byte minutes;
34
35 /** Seconds in the minute, 0 to 60, but might be slightly
36 larger to deal with leap seconds on some systems
37 */
38 byte seconds;
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*/
57BOTAN_DLL calendar_point calendar_value(u64bit time_point);
58
59/**
60* @return seconds resolution timestamp, unknown epoch
61*/
62BOTAN_DLL u64bit system_time();
63
64/**
65* @return nanoseconds resolution timestamp, unknown epoch
66*/
68
69}
70
71#endif
u64bit get_nanoseconds_clock()
Definition time.cpp:93
unsigned long long u64bit
Definition types.h:49
u64bit system_time()
Definition time.cpp:73
calendar_point calendar_value(u64bit a_time_t)
Definition time.cpp:81
unsigned int u32bit
Definition types.h:32
calendar_point(u32bit y, byte mon, byte d, byte h, byte min, byte sec)
Definition time.h:49