|
rllib
1
|
00001 /*************************************************************************** 00002 rltime.h - description 00003 ------------------- 00004 begin : Tue Jan 02 2001 00005 copyright : (C) 2001 by Rainer Lehrig 00006 email : lehrig@t-online.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as * 00013 * published by the Free Software Foundation * 00014 * * 00015 ***************************************************************************/ 00016 #ifndef _RL_TIME_H_ 00017 #define _RL_TIME_H_ 00018 00019 #include "rldefine.h" 00020 00024 class rlTime 00025 { 00026 public: 00027 rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0); 00028 virtual ~rlTime(); 00029 const char *getTimeString(); 00030 const char *getIsoTimeString(); 00031 void getLocalTime(); 00032 int getFileModificationTime(const char *filename); 00033 00037 void setTimeFromString(const char *time_string); 00038 void setTimeFromIsoString(const char *iso_time_string); 00039 void setLocalTime(); 00040 double secondsSinceEpoche(); 00041 rlTime& operator+= (rlTime &time); 00042 rlTime& operator-= (rlTime &time); 00043 rlTime operator+ (rlTime &time); 00044 rlTime operator- (rlTime &time); 00045 int operator== (rlTime &time); 00046 int operator< (rlTime &time); 00047 int operator<= (rlTime &time); 00048 int operator> (rlTime &time); 00049 int operator>= (rlTime &time); 00050 int year; 00051 int month; 00052 int day; 00053 int hour; 00054 int minute; 00055 int second; 00056 int millisecond; 00057 private: 00058 char time_string[32]; // 2001-11-23 12:52:60 0568 00059 }; 00060 #endif
1.7.5.1