• 8395阅读
  • 3回复

[提问]如何将QDateTime类型转换成int类型的数据 [复制链接]

上一主题 下一主题
离线mali3702
 
只看楼主 倒序阅读 楼主  发表于: 2011-11-23
— 本帖被 yfx2003 从 《C++ GUI Qt 4编程》(第2版)专栏 移动到本区(2012-05-10) —
关键词: 求助
        如题所示,求助各位~~~~谢谢
离线jdwx

只看该作者 1楼 发表于: 2011-11-23
回 楼主(mali3702) 的帖子
那两个颜色深度函数。
发帖时要说明:操作系统、Qt版本、编译器,这样能更快的得到回复。
离线ppdayz

只看该作者 2楼 发表于: 2011-11-23
回 楼主(mali3702) 的帖子
uint QDateTime::toTime_t () const
Returns the datetime as the number of seconds that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (Qt::UTC).
On systems that do not support time zones, this function will behave as if local time were Qt::UTC.
Note: This function returns a 32-bit unsigned integer, so it does not support dates before 1970, but it does support dates after 2038-01-19T03:14:06, which may not be valid time_t values. Be careful when passing those time_t values to system functions, which could interpret them as negative dates.
If the date is outside the range 1970-01-01T00:00:00 to 2106-02-07T06:28:14, this function returns -1 cast to an unsigned integer (i.e., 0xFFFFFFFF).
离线mali3702
只看该作者 3楼 发表于: 2011-11-24
回 1楼(jdwx) 的帖子
谢谢了,最后用的是msecTo()函数~~
快速回复
限100 字节
 
上一个 下一个