时间操作、运算、计时的类 更多...
#include <sttnet.h>
Public 成员函数 | |
| bool | startTiming () |
| 开始计时 更多... | |
| Duration | checkTime () |
| 计时过程中检查时间 更多... | |
| Duration | endTiming () |
| 停止计时 更多... | |
| Duration | getDt () |
| 获取上一次计时的时间 更多... | |
| bool | isStart () |
| 返回本对象计时状态 更多... | |
静态 Public 成员函数 | |
| static std::string & | getTime (std::string &timeStr, const std::string &format=ISO8086A) |
| 获取当前时间 更多... | |
| static bool | convertFormat (std::string &timeStr, const std::string &oldFormat, const std::string &newFormat=ISO8086A) |
| 转化时间字符串的格式 更多... | |
| static Duration & | calculateTime (const std::string &time1, const std::string &time2, Duration &result, const std::string &format1=ISO8086A, const std::string &format2=ISO8086A) |
| 计算两个用字符串表示的时间相减的差值 更多... | |
| static std::string & | calculateTime (const std::string &time1, const Duration &time2, std::string &result, const std::string &am, const std::string &format1=ISO8086A, const std::string &format2=ISO8086A) |
| 一个用字符串表示的时间加上或者减去一段时间 更多... | |
| static bool | compareTime (const std::string &time1, const std::string &time2, const std::string &format1=ISO8086A, const std::string &format2=ISO8086A) |
| 比较两个时间字符串表示的时间的大小 更多... | |
|
static |
计算两个用字符串表示的时间相减的差值
| time1 | 被减的时间 |
| time2 | 减去的时间 |
| result | 一个接收结果的Duration容器 |
| format1 | time1的时间字符串格式 yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
| format2 | time2的时间字符串格式 yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
|
static |
一个用字符串表示的时间加上或者减去一段时间
| time1 | 待运算的时间字符串 |
| time2 | 参与运算的用Duration表示的一段时间 |
| result | 接收用字符串表示的运算结果的string容器 |
| am | 填入+:加法运算 填入-:减法运算 |
| format1 | time1的格式 yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
| format2 | result的格式 yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
| Duration stt::time::DateTime::checkTime | ( | ) |
计时过程中检查时间
|
static |
比较两个时间字符串表示的时间的大小
| time1 | 参与比较的第一个字符串 |
| time2 | 参与比较的第二个字符串 |
| format1 | time1的字符串格式 yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
| format2 | time2的字符串格式 yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
|
static |
转化时间字符串的格式
| timeSte | 原时间字符串 |
| oldFormat | 原时间字符串格式 (yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒) |
| newFormat | 新的时间格式 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
| Duration stt::time::DateTime::endTiming | ( | ) |
停止计时
|
inline |
获取上一次计时的时间
|
static |
获取当前时间
| timeStr | 接收时间的字符串容器 |
| format | 指定时间字符串的格式 yyyy年 mm月 dd日 hh时 mi分 ss秒 sss毫秒 (默认格式为'yyyy-mm-ddThh:mi:ss',即ISO08086A标准) |
|
inline |
返回本对象计时状态
| bool stt::time::DateTime::startTiming | ( | ) |
开始计时
1.8.5