libtime++: Date and time calculation
hierarchicaltimestring.cc
Go to the documentation of this file.
1
35
#define TF_HIERARCHICALTIMESTRING_CC_VERSION \
36
"TF_HIERARCHICALTIMESTRING_CC V1.0 "
37
38
#include <sstream>
39
#include <
libtime++.h
>
40
41
namespace
libtime
{
42
43
std::string
TAbsoluteTime::hierarchicalstring
()
const
44
{
45
std::ostringstream oss;
46
oss.width(4);
47
oss.fill(
'0'
);
48
oss << this->
year
() <<
"/"
;
49
oss.width(2);
50
oss.fill(
'0'
);
51
oss << this->
month
() <<
"/"
;
52
oss.width(2);
53
oss.fill(
'0'
);
54
oss << this->
day
() <<
"-"
;
55
oss.width(2);
56
oss.fill(
'0'
);
57
oss << this->
hour
() <<
":"
;
58
oss.width(2);
59
oss.fill(
'0'
);
60
oss << this->
minute
() <<
":"
;
61
oss.width(2);
62
oss.fill(
'0'
);
63
oss << this->
second
() <<
"."
;
64
oss.width(3);
65
oss.fill(
'0'
);
66
oss << this->
milsec
();
67
oss.width(3);
68
oss.fill(
'0'
);
69
oss << this->
micsec
();
70
return
(oss.str());
71
}
72
73
std::string
TRelativeTime::hierarchicalstring
()
const
74
{
75
std::ostringstream oss;
76
oss << this->
days
() <<
"-"
;
77
oss.width(2);
78
oss.fill(
'0'
);
79
oss << this->
hour
() <<
":"
;
80
oss.width(2);
81
oss.fill(
'0'
);
82
oss << this->
minute
() <<
":"
;
83
oss.width(2);
84
oss.fill(
'0'
);
85
oss << this->
second
() <<
"."
;
86
oss.width(3);
87
oss.fill(
'0'
);
88
oss << this->
milsec
();
89
oss.width(3);
90
oss.fill(
'0'
);
91
oss << this->
micsec
();
92
return
(oss.str());
93
}
94
95
}
// namespace libtime
96
97
/* ----- END OF hierarchicaltimestring.cc ----- */
libtime::TRelativeTime::days
timeint days() const
Definition:
libtime++.h:408
libtime::TAbsoluteTime::year
timeint year() const
Definition:
libtime++.h:337
libtime::TAbsoluteTime::month
timeint month() const
Definition:
libtime++.h:339
libtime::TAbsoluteTime::day
timeint day() const
Definition:
libtime++.h:341
libtime::TBaseClassTime::milsec
timeint milsec() const
Definition:
libtime++.h:293
libtime
Definition:
base_constr.cc:45
libtime::TRelativeTime::hierarchicalstring
std::string hierarchicalstring() const
Definition:
hierarchicaltimestring.cc:73
libtime::TBaseClassTime::micsec
timeint micsec() const
Definition:
libtime++.h:294
libtime::TBaseClassTime::hour
timeint hour() const
Definition:
libtime++.h:290
libtime::TBaseClassTime::second
timeint second() const
Definition:
libtime++.h:292
libtime++.h
libtime::TBaseClassTime::minute
timeint minute() const
Definition:
libtime++.h:291
libtime::TAbsoluteTime::hierarchicalstring
std::string hierarchicalstring() const
Definition:
hierarchicaltimestring.cc:43
C++wrapper
hierarchicaltimestring.cc
Generated on Mon Aug 21 2023 17:36:10 for libtime++: Date and time calculation by
1.8.14