TimeUtil.hh
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* TimeUtil.hh
*
* Created on: 29 oct. 2012
* Author: AKKA IS
*/
#ifndef TIMEUTIL_HH_
#define TIMEUTIL_HH_
#include <iostream>
#include <string>
#include "DD_time.hh"
namespace AMDA {
/**
* @class TimeUtil
*/
class TimeUtil {
TimeUtil();
virtual ~TimeUtil();
public:
static void formatTimeInIso(const double time, std::ostream& pOs, t_DDTimeKind timeKind);
static void formatTimeDateInIso(const double time, std::ostream& pOs) {
formatTimeInIso(time, pOs, DD_TM_DATE);
}
static void formatTimeIntervalInIso(const double time, std::ostream& pOs) {
formatTimeInIso(time, pOs, DD_TM_TIME_INTERVAL);
}
static std::string formatTimeInIso(const double time, t_DDTimeKind timeKind);
static std::string formatTimeDateInIso(const double time) {
return formatTimeInIso(time, DD_TM_DATE);
}
static void formatTimeDateWithSpaces(const double time , std::ostream& pOs);
static std::string formatTimeIntervalInIso(const double time) {
return formatTimeInIso(time, DD_TM_TIME_INTERVAL);
}
static double readTimeInIso(char *stime);
static void double2DD_Time(const double time, std::ostream& pOs, t_DDTimeKind timeKind );
static void double2DD_TimeDate(const double time, std::ostream& pOs) {
double2DD_Time(time, pOs, DD_TM_DATE);
}
static void double2DD_TimeInterval(const double time, std::ostream& pOs){
double2DD_Time(time, pOs, DD_TM_TIME_INTERVAL);
}
static std::string double2DD_Time(const double time, t_DDTimeKind timeKind);
static std::string double2DD_TimeDate(const double time) {
return double2DD_Time(time, DD_TM_DATE);
}
static std::string double2DD_TimeInterval(const double time){
return double2DD_Time(time, DD_TM_TIME_INTERVAL);
}
static std::string DD2ISO_Time(std::string time, t_DDTimeKind timeKind );
static std::string DD2ISO_TimeDate(std::string time) {
return DD2ISO_Time(time, DD_TM_DATE);
}
static std::string DD2ISO_TimeInterval(std::string time) {
return DD2ISO_Time(time, DD_TM_TIME_INTERVAL);
}
// static std::string DD2ISO_IntervalTime(std::string time, t_DDTimeKind timeKind) {
// return DD2ISO_Time((time , DD_TM_TIME_INTERVAL);
// }
private:
static int monthday[2][12];
};
} /* namespace AMDA */
#endif /* TIMEUTIL_HH_ */