26 typedef unsigned long long ReplTime;
37 static void setLast(
const Date_t &date) {
40 signed getSecs()
const {
44 reinterpret_cast<long long&
>(*this) = date.millis;
47 reinterpret_cast<unsigned long long&
>(*this) = x;
64 signed t = (signed) time(0);
65 if ( t < last.secs ) {
81 if ( last.secs == t ) {
96 long long asDate()
const {
98 memcpy( (
char *)&time, &i,
sizeof(
unsigned ) ) ;
99 memcpy( (
char *)&time +
sizeof(
unsigned ), &secs,
104 long long asLL()
const {
106 memcpy( (
char *)&time, &i,
sizeof(
unsigned ) ) ;
107 memcpy( (
char *)&time +
sizeof(
unsigned ), &secs,
113 bool isNull()
const {
return secs == 0; }
115 string toStringLong()
const {
117 time_t_to_String(secs, buf);
119 ss << time_t_to_String_short(secs) <<
' ';
120 ss << hex << secs <<
':' << i;
124 string toStringPretty()
const {
126 ss << time_t_to_String_short(secs) <<
':' << hex << i;
130 string toString()
const {
132 ss << hex << secs <<
':' << i;
136 bool operator==(
const OpTime& r)
const {
137 return i == r.i && secs == r.secs;
139 bool operator!=(
const OpTime& r)
const {
140 return !(*
this == r);
142 bool operator<(
const OpTime& r)
const {
143 int l_secs = ( int ) secs ;
144 int r_secs = ( int ) r.secs ;
145 if ( l_secs != r_secs )
146 return l_secs < r_secs;
149 bool operator<=(
const OpTime& r)
const {
150 return *
this < r || *
this == r;
152 bool operator>(
const OpTime& r)
const {
153 return !(*
this <= r);
155 bool operator>=(
const OpTime& r)
const {