ZFFramework
 
Loading...
Searching...
No Matches
ZFTime.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFTime_h_
7#define _ZFI_ZFTime_h_
8
9#include "ZFObject.h"
11
12// ============================================================
13// ZFTimeValue
23
24
37
46 , ZFMP_IN(zftimet, sec)
47 , ZFMP_IN(zftimet, usec)
48 ) {
49 ZFTimeValue ret = {sec, usec};
50 return ret;
51}
52
59 , ZFMP_IN(zftimet, t)
60 ) {
61 ZFTimeValue ret = {(zftimet)(t / 1000), (zftimet)((t % 1000) * 1000)};
62 return ret;
63}
64
70 , ZFMP_IN(const ZFTimeValue &, v)
71 ) {
72 return (zftimet)(v.sec * 1000 + v.usec / 1000);
73}
74
80 )
81
82
86 , ZFMP_OUT(ZFTimeValue &, result)
87 , ZFMP_IN(const ZFTimeValue &, tv1)
88 , ZFMP_IN(const ZFTimeValue &, tv2)
89 ) {
90 result.sec = tv1.sec - tv2.sec;
91 result.usec = tv1.usec - tv2.usec;
93}
94
98 , ZFMP_IN(const ZFTimeValue &, tv1)
99 , ZFMP_IN(const ZFTimeValue &, tv2)
100 ) {
101 ZFTimeValue result;
102 ZFTimeValueDec(result, tv1, tv2);
103 return result;
104}
105
110 , ZFMP_OUT(ZFTimeValue &, result)
111 , ZFMP_IN(const ZFTimeValue &, tv1)
112 , ZFMP_IN(const ZFTimeValue &, tv2)
113 ) {
114 result.sec = tv1.sec + tv2.sec;
115 result.usec = tv1.usec + tv2.usec;
116 ZFTimeValueNormalize(result);
117}
118
122 , ZFMP_IN(const ZFTimeValue &, tv1)
123 , ZFMP_IN(const ZFTimeValue &, tv2)
124 ) {
125 ZFTimeValue result;
126 ZFTimeValueInc(result, tv1, tv2);
127 return result;
128}
129
134 , ZFMP_OUT(ZFTimeValue &, result)
135 , ZFMP_IN(const ZFTimeValue &, tv)
136 , ZFMP_IN(zfindex, v)
137 ) {
138 result.sec = tv.sec * v;
139 result.usec = tv.usec * v;
140 ZFTimeValueNormalize(result);
141}
142
146 , ZFMP_IN(const ZFTimeValue &, tv)
147 , ZFMP_IN(zfindex, v)
148 ) {
149 ZFTimeValue result;
150 ZFTimeValueMul(result, tv, v);
151 return result;
152}
153
158 , ZFMP_OUT(ZFTimeValue &, result)
159 , ZFMP_IN(const ZFTimeValue &, tv)
160 , ZFMP_IN(zfindex, v)
166 , ZFMP_IN(const ZFTimeValue &, tv)
167 , ZFMP_IN(zfindex, v)
168 ) {
169 ZFTimeValue result;
170 ZFTimeValueDiv(result, tv, v);
171 return result;
172}
173
179 , ZFMP_IN(const ZFTimeValue &, tv1)
180 , ZFMP_IN(const ZFTimeValue &, tv2)
182
183
189 , ZFMP_IN_OUT(zfstring &, s)
190 , ZFMP_IN(ZFTimeValue const &, v)
194 , ZFMP_IN(ZFTimeValue const &, v)
195 ) {
196 zfstring s;
198 return s;
199}
200
202inline zfbool operator == (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return (ZFTimeValueCompare(v0, v1) == ZFCompareEqual);}
203inline zfbool operator != (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return (ZFTimeValueCompare(v0, v1) != ZFCompareEqual);}
204inline zfbool operator < (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return (ZFTimeValueCompare(v0, v1) == ZFCompareSmaller);}
205inline zfbool operator <= (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return (ZFTimeValueCompare(v0, v1) != ZFCompareGreater);}
206inline zfbool operator > (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return (ZFTimeValueCompare(v0, v1) == ZFCompareGreater);}
207inline zfbool operator >= (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return (ZFTimeValueCompare(v0, v1) != ZFCompareSmaller);}
208inline ZFTimeValue operator + (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return ZFTimeValueInc(v0, v1);}
209inline ZFTimeValue operator - (ZF_IN const ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {return ZFTimeValueDec(v0, v1);}
210inline void operator += (ZF_IN_OUT ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {ZFTimeValueInc(v0, v0, v1);}
211inline void operator -= (ZF_IN_OUT ZFTimeValue &v0, ZF_IN const ZFTimeValue &v1) {ZFTimeValueDec(v0, v0, v1);}
212inline ZFTimeValue operator * (ZF_IN const ZFTimeValue &v0, ZF_IN zfindex v1) {return ZFTimeValueMul(v0, v1);}
213inline ZFTimeValue operator / (ZF_IN const ZFTimeValue &v0, ZF_IN zfindex v1) {return ZFTimeValueDiv(v0, v1);}
214inline void operator *= (ZF_IN_OUT ZFTimeValue &v0, ZF_IN zfindex v1) {ZFTimeValueMul(v0, v0, v1);}
215inline void operator /= (ZF_IN_OUT ZFTimeValue &v0, ZF_IN zfindex v1) {ZFTimeValueDiv(v0, v0, v1);}
217
218// ============================================================
219// ZFTimeInfo
235
239
248 , ZFMP_IN(zfint const &, year)
249 , ZFMP_IN(zfuint const &, month)
250 , ZFMP_IN(zfuint const &, day)
251 , ZFMP_IN(zfuint const &, hour)
252 , ZFMP_IN(zfuint const &, minute)
253 , ZFMP_IN(zfuint const &, second)
254 , ZFMP_IN(zfuint const &, miliSecond)
255 , ZFMP_IN(zfuint const &, microSecond)
256 ) {
257 ZFTimeInfo ret = {year, month, day, hour, minute, second, miliSecond, microSecond};
258 return ret;
259}
260
265 , ZFMP_IN_OUT(zfstring &, s)
266 , ZFMP_IN(ZFTimeInfo const &, v)
270 , ZFMP_IN(ZFTimeInfo const &, v)
271 ) {
272 zfstring s;
274 return s;
275}
276
277// ============================================================
278// ZFTime
280#define ZFSerializableKeyword_ZFTime_timeValue "timeValue"
282#define ZFSerializableKeyword_ZFTime_timeZone "timeZone"
283
284zfclassFwd _ZFP_ZFTimePrivate;
307zfclass ZFLIB_ZFCore ZFTime : zfextend ZFObject, zfimplement ZFSerializable, zfimplement ZFCopyable {
308 ZFOBJECT_DECLARE(ZFTime, ZFObject)
309 ZFIMPLEMENT_DECLARE(ZFSerializable, ZFCopyable)
310
311protected:
314 ZF_IN const ZFSerializableData &serializableData
315 , ZF_OUT_OPT zfstring *outErrorHint = zfnull
316 , ZF_OUT_OPT ZFSerializableData *outErrorPos = zfnull
317 );
320 ZF_IN_OUT ZFSerializableData &serializableData
321 , ZF_OUT_OPT zfstring *outErrorHint = zfnull
322 , ZF_IN_OPT ZFSerializable *refOwner = zfnull
323 );
324
325protected:
327 virtual void copyableOnCopyFrom(ZF_IN ZFObject *anotherObj) {
328 zfsuperI(ZFCopyable)::copyableOnCopyFrom(anotherObj);
329 this->timeValue(zfcast(zfself *, anotherObj)->timeValue());
330 this->timeZone(zfcast(zfself *, anotherObj)->timeZone());
331 }
332
333public:
338 , ZFMP_IN(zfint, year)
345 , ZFMP_IN(zfint, year1)
346 , ZFMP_IN(zfint, year2)
348
358
371 , ZFMP_IN_OPT(const ZFTimeValue &, localTimeZone, ZFTime::timeZoneLocal())
377 , ZFMP_OUT(ZFTimeInfo &, ti)
378 , ZFMP_IN(const ZFTimeValue &, tv)
384 , ZFMP_OUT(ZFTimeValue &, tv)
385 , ZFMP_IN(const ZFTimeInfo &, ti)
400 );
401
410
411protected:
420 ZFMP_IN(const ZFTimeValue &, tv)
421 , ZFMP_IN_OPT(const ZFTimeValue &, timeZone, ZFTime::timeZoneLocal)()
427 ZFMP_IN(const ZFTimeInfo &, ti)
428 , ZFMP_IN_OPT(const ZFTimeValue &, timeZone, ZFTime::timeZoneLocal)()
430
432 virtual void objectOnInit(void);
434 virtual void objectOnDealloc(void);
435
436protected:
439
440public:
443
448 virtual ZFCompareResult objectCompareImpl(ZF_IN ZFObject *anotherObj);
449
450public:
455 , ZFMP_IN(const ZFTimeValue &, tv)
461
467 , ZFMP_IN(const ZFTimeValue &, timeZone)
473
478
493 , ZF_IN_OPT const ZFTimeValue &tz = ZFTime::timeZoneLocal()
494 );
501 , ZFMP_IN(const ZFTimeInfo &, ti)
502 , ZFMP_IN_OPT(const ZFTimeValue &, tz, ZFTime::timeZoneLocal())
508
513
518
523
532
537
542
547
552
557
558private:
559 _ZFP_ZFTimePrivate *d;
560};
561
562// ============================================================
564#define zftimetOneMinute 60LL
566#define zftimetOneHour 3600LL // 60 * 60
568#define zftimetOneDay 86400LL // 60 * 60 * 24
570#define zftimetOneWeek 604800LL // 60 * 60 * 24 * 7
572#define zftimetOneMonth 2592000LL // 60 * 60 * 24 * 30
574#define zftimetOneYear 31536000LL // 60 * 60 * 24 * 365
575
577#endif // #ifndef _ZFI_ZFTime_h_
578
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define zfclassPOD
shows the class is a POD type
Definition ZFCoreTypeDef_ClassType.h:35
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
_ZFT_t_zfint zfint
same as int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:165
_zft_zftimet zftimet
time unit, ensured at least 64 bit, ensured signed
Definition ZFCoreTypeDef_CoreType.h:203
_zft_zfidentity zfidentity
identity type, ensured at least 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:225
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
_ZFT_t_zfuint zfuint
same as unsigned int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:169
#define ZFOUTPUT_TYPE_DECLARE(ZFLIB_, T_Type)
see ZFOUTPUT_TYPE
Definition ZFCoreTypeDef_OtherType.h:244
#define ZFOUTPUT_TYPE(T_Type, outputAction)
declare your custom type conversion to string, convenient for debug
Definition ZFCoreTypeDef_OtherType.h:221
ZFCompareResult
compare result of two ZFObjects
Definition ZFCoreTypeDef_OtherType.h:28
@ ZFCompareSmaller
Definition ZFCoreTypeDef_OtherType.h:30
@ ZFCompareEqual
Definition ZFCoreTypeDef_OtherType.h:31
@ ZFCompareGreater
Definition ZFCoreTypeDef_OtherType.h:32
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFCORE_POD_DECLARE_NO_COMPARER(Type)
explicitly declare as POD
Definition ZFCoreUtilTemplate.h:563
#define ZFCORE_POD_DECLARE(Type)
explicitly declare as POD
Definition ZFCoreUtilTemplate.h:554
#define ZFEXPORT_VAR_READONLY_DECLARE(ZFLIB_, Type, Name)
see ZFEXPORT_VAR_DECLARE
Definition ZFExport.h:115
#define ZFMP_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#define ZFMP_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:111
#define ZFMP_IN_OPT(ParamType, paramName, DefaultValue)
see ZFMP_IN
Definition ZFMethod.h:108
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#define ZFMETHOD_DECLARE_STATIC_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:708
#define ZFMETHOD_DECLARE_2(ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMethod
Definition ZFMethodDeclare.h:1025
#define ZFMETHOD_DECLARE_STATIC_2(ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMethod
Definition ZFMethodDeclare.h:1042
#define ZFMETHOD_DECLARE_STATIC_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:870
#define ZFMETHOD_DECLARE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:854
#define ZFMETHOD_FUNC_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:763
#define ZFMETHOD_FUNC_INLINE_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:835
#define ZFMETHOD_FUNC_INLINE_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:692
#define ZFMETHOD_FUNC_DECLARE_3(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:910
#define ZFMETHOD_FUNC_INLINE_DECLARE_8(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2, ZFMP_3, ZFMP_4, ZFMP_5, ZFMP_6, ZFMP_7)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:1861
#define ZFMETHOD_FUNC_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:624
#define ZFMETHOD_FUNC_INLINE_DECLARE_3(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:986
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
ZFObject related include.
#define zfcast(T_To, obj)
safely cast ZFObject types, return null if not desired type
Definition ZFObjectCast.h:28
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_ON_INIT_DECLARE_2(ZFMP_0, ZFMP_1)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:290
#define ZFOBJECT_ON_INIT_DECLARE_1(ZFMP_0)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:263
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define zfsuperI(T_SuperType)
class ref to proper super type, see ZFObject for more info
Definition ZFObjectDeclare.h:26
#define ZFIMPLEMENT_DECLARE(ImplementedInterfaces,...)
see ZFINTERFACE_DECLARE
Definition ZFObjectInterface.h:169
#define zfimplement
shows class implement from interface, see ZFInterface
Definition ZFObjectInterface.h:24
void ZFTimeValueDiv(ZFTimeValue &result, const ZFTimeValue &tv, zfindex v)
return tv / v, assert fail if v is 0
ZFCompareResult ZFTimeValueCompare(const ZFTimeValue &tv1, const ZFTimeValue &tv2)
compare two ZFTimeValue
zfbool ZFTimeInfoToStringT(zfstring &s, ZFTimeInfo const &v)
convert ZFTimeInfo to string
ZFTimeValue ZFTimeValueCreate(zftimet sec, zftimet usec)
make a time value
Definition ZFTime.h:48
void ZFTimeValueInc(ZFTimeValue &result, const ZFTimeValue &tv1, const ZFTimeValue &tv2)
return tv1 + tv2
Definition ZFTime.h:113
zfstring ZFTimeValueToStringFriendly(ZFTimeValue const &v)
see ZFTimeValueToStringFriendlyT
Definition ZFTime.h:195
ZFTimeValue ZFTimeValueFromMiliSeconds(zftimet t)
convert between ZFTimeValue and zftimet (in miliseconds)
Definition ZFTime.h:60
zfbool ZFTimeValueToStringT(zfstring &s, _ZFP_PropTypeW_ZFTimeValue const &v, zfstring *errorHint=zft_zfnull)
util method to convert ZFTimeValue to string
void ZFTimeValueMul(ZFTimeValue &result, const ZFTimeValue &tv, zfindex v)
return tv * v
Definition ZFTime.h:137
ZFTimeInfo const & ZFTimeInfoZero(void)
a zero time info (1970-01-01 00:00:00.000 000)
Definition ZFTime.h:243
ZFTimeInfo ZFTimeInfoCreate(zfint const &year, zfuint const &month, zfuint const &day, zfuint const &hour, zfuint const &minute, zfuint const &second, zfuint const &miliSecond, zfuint const &microSecond)
make a time info, you should make sure value is valid
Definition ZFTime.h:256
zftimet ZFTimeValueToMiliSeconds(const ZFTimeValue &v)
convert between ZFTimeValue and zftimet (in miliseconds)
Definition ZFTime.h:71
ZFTimeValue const & ZFTimeValueZero(void)
a zero time value
Definition ZFTime.h:41
zfbool ZFTimeValueToStringFriendlyT(zfstring &s, ZFTimeValue const &v)
convert ZFTimeValue to more readable string, see ZFTimeValueToString
void ZFTimeValueDec(ZFTimeValue &result, const ZFTimeValue &tv1, const ZFTimeValue &tv2)
return tv1 - tv2
Definition ZFTime.h:89
void ZFTimeValueNormalize(ZFTimeValue &v)
normalize time value
zfstring ZFTimeInfoToString(ZFTimeInfo const &v)
see ZFTimeInfoToStringT
Definition ZFTime.h:271
#define ZFTYPEID_DECLARE(ZFLIB_, TypeName, Type)
register a type for reflection
Definition ZFTypeIdDeclare.h:137
#define ZFTYPEID_ACCESS_ONLY_REG(ZFLIB_, TypeName, Type,...)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:205
#define ZFTYPEID_ACCESS_ONLY_DECLARE(ZFLIB_, TypeName, Type)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:195
#define ZFTYPEID_REG(ZFLIB_, TypeName, Type,...)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:151
ZFUIMargin & operator+=(ZFUIMargin &v0, const ZFUIMargin &v1)
v0 += v1
Definition ZFUITypeDef.h:325
ZFUIMargin & operator-=(ZFUIMargin &v0, const ZFUIMargin &v1)
v0 -= v1
Definition ZFUITypeDef.h:381
ZFUIMargin operator+(const ZFUIMargin &v0, const ZFUIMargin &v1)
v0 + v1
Definition ZFUITypeDef.h:310
ZFUIMargin operator-(const ZFUIMargin &v0, const ZFUIMargin &v1)
v0 - v1
Definition ZFUITypeDef.h:366
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:74
static zfbool timeInfoFromTimeValue(ZFTimeInfo &ti, const ZFTimeValue &tv)
convert time value to time info
virtual zfint year()
year since 0000, e.g. 2012
ZFTime zfself
class ref to self
Definition ZFTime.h:308
static zftimet currentTime()
equal to ZFTimeValueToMiliSeconds(currentTimeValue())
virtual const ZFTimeValue & timeValueAppliedTimeZone()
get time value which has been applied by time zone offset
virtual ZFCompareResult objectCompareImpl(ZFObject *anotherObj)
compared by timeValueAppliedTimeZone
static zftimet timestamp()
get timestamp in mili seconds
static zfint leapYearBetween(zfint year1, zfint year2)
return leap year num in range [year1, year2], may return negative value if (year1 > year2)
virtual zfuint day()
day of month range in [0, 27...30]
virtual zfbool timeInfo(zfint year, zfuint month, zfuint day, zfuint hour, zfuint minute, zfuint second, zfuint miliSecond, zfuint microSecond, const ZFTimeValue &tz=ZFTime::timeZoneLocal())
set time according to time info
virtual zfuint month()
month range in [0, 11]
static const ZFTimeValue & timeZoneLocal()
get current time zone
virtual void objectInfoImplAppend(zfstring &ret)
see objectInfo
virtual zfbool timeZone(const ZFTimeValue &timeZone)
set time zone attched to this ZFTime object
virtual zfbool timeValue(const ZFTimeValue &tv)
set time according to time value
virtual void objectOnInit(ZFTime *time)
init from another ZFTime
virtual void objectOnDealloc(void)
override this to destroy your object
virtual zfuint hour()
hour range in [0, 23]
virtual zfbool serializableOnSerializeFromData(const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
for serializable data that has "category" attribute, ZFSerializable would ignore it and leave it to s...
static zfbool timeInfoToTimeValue(ZFTimeValue &tv, const ZFTimeInfo &ti)
convert time info to time value
virtual zfuint minute()
minute range in [0, 59]
virtual zfuint microSecond()
microSecond range in [0, 999]
virtual zfuint second()
second range in [0, 59]
virtual zfidentity objectHashImpl(void)
see objectHash
virtual zfuint miliSecond()
miliSecond range in [0, 999]
static ZFTimeValue currentTimeValue()
return time since ZFTimeInfoZero, negative if before ZFTimeInfoZero
virtual void copyableOnCopyFrom(ZFObject *anotherObj)
called by copy to copy contents from anotherObj
Definition ZFTime.h:327
static ZFTimeInfo currentTimeInfo(const ZFTimeValue &localTimeZone=(ZFTime::timeZoneLocal()))
return current time info, util method to currentTimeValue
virtual zfuint dayOfWeek()
day of week range in [0, 6], while 0 stands for Sunday
virtual zfbool serializableOnSerializeToData(ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
corresponding to serializableOnSerializeFromData, return whether the task is success,...
virtual zfuint dayOfYear()
day of year range in [0, 364/365]
store a time info, internal use only
Definition ZFTime.h:223
zfint year
Definition ZFTime.h:225
zfuint microSecond
Definition ZFTime.h:232
zfuint day
Definition ZFTime.h:227
zfuint miliSecond
Definition ZFTime.h:231
zfuint minute
Definition ZFTime.h:229
zfuint hour
Definition ZFTime.h:228
zfuint month
Definition ZFTime.h:226
zfuint second
Definition ZFTime.h:230
store a time value
Definition ZFTime.h:17
zftimet usec
Definition ZFTime.h:20
zftimet sec
Definition ZFTime.h:19