⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qdatetime.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
字号:
.TH QDateTime 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQDateTime \- Date and time functions.SH SYNOPSIS.br.PP\fC#include <qdatetime.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "\fBQDateTime\fR () ".br.ti -1c.BI "\fBQDateTime\fR ( const QDate & ) ".br.ti -1c.BI "\fBQDateTime\fR ( const QDate &, const QTime & ) ".br.ti -1c.BI "bool \fBisNull\fR () const".br.ti -1c.BI "bool \fBisValid\fR () const".br.ti -1c.BI "QDate \fBdate\fR () const".br.ti -1c.BI "QTime \fBtime\fR () const".br.ti -1c.BI "void \fBsetDate\fR ( const QDate & date ) ".br.ti -1c.BI "void \fBsetTime\fR ( const QTime & time ) ".br.ti -1c.BI "void \fBsetTime_t\fR ( uint secsSince1Jan1970UTC ) ".br.ti -1c.BI "QString \fBtoString\fR () const".br.ti -1c.BI "QDateTime \fBaddDays\fR ( int days ) const".br.ti -1c.BI "QDateTime \fBaddSecs\fR ( int secs ) const".br.ti -1c.BI "int \fBdaysTo\fR ( const QDateTime & ) const".br.ti -1c.BI "int \fBsecsTo\fR ( const QDateTime & ) const".br.ti -1c.BI "bool \fBoperator==\fR ( const QDateTime & dt ) const".br.ti -1c.BI "bool \fBoperator!=\fR ( const QDateTime & dt ) const".br.ti -1c.BI "bool \fBoperator<\fR ( const QDateTime & dt ) const".br.ti -1c.BI "bool \fBoperator<=\fR ( const QDateTime & dt ) const".br.ti -1c.BI "bool \fBoperator>\fR ( const QDateTime & dt ) const".br.ti -1c.BI "bool \fBoperator>=\fR ( const QDateTime & dt ) const".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QDateTime \fBcurrentDateTime\fR () ".br.in -1c.SH RELATED FUNCTION DOCUMENTATION(Note that these are not member functions.).in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR (QDataStream & " "s" ", const QDateTime & " "dt" ")".br.ti -1c.BI "QDataStream & \fBoperator>>\fR (QDataStream & " "s" ", QDateTime & " "dt" ")".br.in -1c.SH DESCRIPTIONThe QDateTime class provides date and time functions..PPA QDateTime object contains a calendar date and a clock time (a "datetime"). It is a combination of the QDate and QTime classes. It can read the current datetime from the system clock. It provides functions for comparing datetimes and for manipulating a datetime by adding a number of seconds or days..PPA QDateTime object is typically created either by giving a date and time explicitly, or by using the static function currentTime(), which makes a QDateTime object which contains the system's clock time..PPThe date() and time() functions provide access to the date and time parts of the datetime. The same information is provided in textual format by the toString() function..PPQDateTime provides a full set of operators to compare two QDateTime objects. A datetime is considered smaller than another if it is earlier than the other..PPThe datetime a given number of days or seconds later than a given datetime can be found using the addDays() and addSecs() functions. Correspondingly, the number of days or seconds between two times can be found using the daysTo() or secsTo() functions..PPA datetime can also be set using the setTime_t() function, which takes a POSIX-standard "number of seconds since 00:00:00 on January 1, 1970" value..PPThe limitations regarding range and resolution mentioned in the QDate and QTime documentation apply for QDateTime also..PPSee also QDate and QTime..SH MEMBER FUNCTION DOCUMENTATION.SH "QDateTime::QDateTime ()"Constructs a null datetime (i.e. null date and null time). A null datetime is invalid, since the date is invalid..PPSee also isValid()..SH "QDateTime::QDateTime ( const QDate & date )"Constructs a datetime with date \fIdate\fR and null time (00:00:00.000)..SH "QDateTime::QDateTime ( const QDate & date, const QTime & time )"Constructs a datetime with date \fIdate\fR and time \fItime.\fR.SH "QDateTime QDateTime::addDays ( int ndays ) const"Returns a QDateTime object containing a datetime \fIndays\fR days later than the datetime of this object (or earlier if \fIndays\fR is negative)..PPSee also daysTo() and addSecs()..SH "QDateTime QDateTime::addSecs ( int nsecs ) const"Returns a QDateTime object containing a datetime \fInsecs\fR seconds later than the datetime of this object (or earlier if \fInsecs\fR is negative)..PPSee also secsTo() and addDays()..SH "QDateTime QDateTime::currentDateTime () \fC[static]\fR"Returns the current datetime, as reported by the system clock..PPSee also QDate::currentDate() and QTime::currentTime()..SH "QDate QDateTime::date () const"Returns the date part of this datetime..PPSee also setDate() and time()..SH "int QDateTime::daysTo ( const QDateTime & dt ) const"Returns the number of days from this datetime to \fIdt\fR (which is negative if \fIdt\fR is earlier than this datetime)..PPSee also addDays() and secsTo()..SH "bool QDateTime::isNull () const"Returns TRUE if both the date and the time are null. A null date is invalid..PPSee also QDate::isNull() and QTime::isNull()..SH "bool QDateTime::isValid () const"Returns TRUE if both the date and the time are valid..PPSee also QDate::isValid() and QTime::isValid()..SH "bool QDateTime::operator!= ( const QDateTime & dt ) const"Returns TRUE if this datetime is different from \fIdt,\fR or FALSE if they are equal..PPSee also operator==()..SH "bool QDateTime::operator< ( const QDateTime & dt ) const"Returns TRUE if this datetime is earlier than \fIdt,\fR otherwise FALSE..SH "bool QDateTime::operator<= ( const QDateTime & dt ) const"Returns TRUE if this datetime is earlier than or equal to \fIdt,\fR otherwise FALSE..SH "bool QDateTime::operator== ( const QDateTime & dt ) const"Returns TRUE if this datetime is equal to \fIdt,\fR or FALSE if they are different..PPSee also operator!=()..SH "bool QDateTime::operator> ( const QDateTime & dt ) const"Returns TRUE if this datetime is later than \fIdt,\fR otherwise FALSE..SH "bool QDateTime::operator>= ( const QDateTime & dt ) const"Returns TRUE if this datetime is later than or equal to \fIdt,\fR otherwise FALSE..SH "int QDateTime::secsTo ( const QDateTime & dt ) const"Returns the number of seconds from this datetime to \fIdt\fR (which is negative if \fIdt\fR is earlier than this datetime)..PPExample:.PP.nf.br    QDateTime dt = QDateTime::currentDateTime();.br    QDateTime x( QDate(dt.year(),12,24), QTime(17,00) );.br    qDebug( "There are %d seconds to Christmas", dt.secsTo(x) );.fi.PPSee also addSecs(), daysTo() and QTime::secsTo()..SH "void QDateTime::setDate ( const QDate & date )"Sets the date part of this datetime..PPSee also date() and setTime()..SH "void QDateTime::setTime ( const QTime & time )"Sets the time part of this datetime..PPSee also time() and setDate()..SH "void QDateTime::setTime_t ( uint secsSince1Jan1970UTC )"Sets the local date and time given the number of seconds that have passed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC). On systems that do not support timezones this function will behave as if local time were UTC..PPNote that Microsoft Windows supports only a limited range of values for \fIsecsSince1Jan1970UTC.\fR.SH "QTime QDateTime::time () const"Returns the time part of this datetime..PPSee also setTime() and date()..SH "QString QDateTime::toString () const"Returns the datetime as a string..PPThe string format is "Sat May 20 03:40:13 1998"..PPThis function uses QDate::dayName(), QDate::monthName(), and QTime::toString() to generate the string..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< (QDataStream & s, const QDateTime & dt)"Writes a datetime to the stream..PPSee also Format of the QDataStream operators.SH "QDataStream & operator>> (QDataStream & s, QDateTime & dt)"Reads a datetime from the stream..PPSee also  Format of the QDataStream operators.SH "SEE ALSO".BR http://doc.trolltech.com/qdatetime.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -