Belle II Software development
Date.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#ifndef _Belle2_Date_hh
9#define _Belle2_Date_hh
10
11#include <time.h>
12
13namespace Belle2 {
19 class Date {
20
21 public:
22 Date(time_t time);
23 Date(const Date& date);
24 Date();
25 ~Date();
26
27 public:
28 void set();
29 void set(time_t time);
30 time_t get() const { return m_time; }
31 int getSecond() const;
32 int getMinitue() const;
33 int getHour() const;
34 int getDay() const;
35 int getMonth() const;
36 int getYear() const;
37 const char* toString(const char* format = NULL) const;
38
39 public:
40 const Date& operator=(const Date& date)
41 {
42 set(date.m_time);
43 return *this;
44 }
45
46 private:
47 time_t m_time;
48 struct tm* m_tm;
49 mutable char m_str[31];
50
51 };
52
54};
55
56#endif
Abstract base class for different kinds of events.