📄 otimespan.h
字号:
/* Copyright(C) 2000 by JiangSu Bell Software CO.,LTD. */
/*
****************************************************************************
Content: definition of class OTimeSpan
Name: otimespan.h Version: 1.0.0
Created by: CaoGuiRong Date: 2000-08-23
Comment:
All rights reserved
****************************************************************************
*/
#ifndef _OTIMESPAN_
#define _OTIMESPAN_
#include <string.h>
const long SECOND_OF_DAY = 86400;
const long SECOND_OF_HOUR = 3600;
const long SECOND_OF_MINUTE = 60;
const long MINUTE_OF_HOUR = 60;
const long HOUR_OF_DAY = 24;
const long MINUTE_OF_DAY = 1440;
/***********************************************************************
Class: OTimeSpan Version: 1.0.0
Created by CaoGuirong Date: 2000-08-23
Implementation File: otimespan.cpp
Comment: 时间差的处理类
***********************************************************************/
/* Modifications
*/
class OTimeSpan
{
public:
OTimeSpan() ;
OTimeSpan( OTimeSpan& otimespan );
OTimeSpan( const long lday, const short shour ,const short smin,const short ssec );
OTimeSpan( const long lday, const long ssecond );
OTimeSpan( const long lsecond );
~OTimeSpan() ;
short Set( const long lday, const short shour ,const short smin,const short ssec);
short Set( const long lday, const long ssecond ) ;
void SetSecond( const long lsecond ) ;
long GetDay() ; //不算零头,总共有多少天
long GetHour(); //除去天数,不算零头,总共还有多少小时
long GetMinute(); //除去小时数,不算零头,总共还有多少分钟
long GetSecond(); //除去分钟数,还剩多少秒
long GetSecondinDay(); //不算天数,总共有多少秒
long GetTotalHour(); //不算零头,总共有多少小时
long GetTotalMinute(); //不算零头,总共有多少分钟
long GetTotalSecond(); //总共有多少秒
OTimeSpan operator + ( OTimeSpan otimespan ) ;
OTimeSpan operator - ( OTimeSpan otimespan ) ;
OTimeSpan operator = ( OTimeSpan otimespan ) ;
// OTimeSpan operator = ( OTimeSpan otimespan ) ;
OTimeSpan& operator += ( OTimeSpan& otimespan ) ;
OTimeSpan& operator -= ( OTimeSpan& otimespan ) ;
short operator == ( OTimeSpan otimespan ) ;
short operator != ( OTimeSpan otimespan ) ;
short operator < ( OTimeSpan otimespan ) ;
short operator > ( OTimeSpan otimespan ) ;
short operator <= ( OTimeSpan otimespan ) ;
short operator >= ( OTimeSpan otimespan ) ;
private:
long m_lday,m_lsecond;
};
#endif//endif _OTIMESPAN_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -