Questions tagged [qdatetime]

A QDateTime is a class from the Qt toolkit which provides functions for working with both dates and times.

A QDateTime object is a combination of the QDate and QTime classes which contains information about a calendar date and clock time. It can read the current date and time from the system clock, and also provides functions for comparing, formatting and parsing date/times, and for performing basic date/time calculations.

The official documentation can be found here.

88 questions
0
votes
1 answer

QCubed how to save QDateTime as NULL

my QCubed PHP class "Project" has a property called "Finished" which is object of QDateTime and data type "datetime" in MySQL database. I need to save NULL into database when user leaves this field blank in HTML
Nebster
  • 884
  • 1
  • 11
  • 19
0
votes
1 answer

Read QDateTime from QDataStream giving null

I have the following region of data being read into a QDataStream object : DE 07 05 19 0E 28 1A This should translate to the date/time: 25-05-2014 15:40:26 I am trying to use the following to read this into a QDateTime variable: QFile…
TenG
  • 3,843
  • 2
  • 25
  • 42
0
votes
1 answer

How to change dateTimeFromText to only allow minutes%15 or disable manual text input?

I have extended QDateTimeEdit to do steps in intervals of 15 minutes by overwriting stepBy(int steps). So if a user scrolls up the minutes-section, the only choices they have are 0, 15, 30 and 45. One problem appears if a user enters the dateTime…
user4063815
0
votes
1 answer

Issue with QDateTime (currentDateTime() and fromString())

I have been trying to use QDateTime in my program for a while now, to no such luck. I am not sure what I am doing wrong and it is driving me a tad mad. Code snippet as follows: QDateTime dteNow = QDateTime::currentDateTime(); QDateTime dteStart =…
GenericMadman
  • 57
  • 1
  • 8
0
votes
1 answer

cannot convert parameter 1 from QDateTime to 'tTimeMods'

I have a struct tTimeMods which contains QDateTime variables. I have a function which returns this struct. I get one compilation error as mentioned in the title, at the foll line inside compareTimeMods(tTimeMods timeTypeFunction):- QString…
cappy0704
  • 557
  • 2
  • 9
  • 30
0
votes
1 answer

QVariant is not able to distinguish between QDateTime and QString

I have a QDateTime object which I store in a QVariant and then I check the QVariant with type() but it behaves strangely when I check the type. void MainWindow::Test() { QDateTime myDate; // QDateTime; …
anbu selvan
  • 725
  • 3
  • 13
  • 41
0
votes
1 answer

Changing language of QDateTimeEdit calendar popup

I've created QDateTimeEdit widget in QtDesigner with calendarPopup option checked. I need months to be shown in English language but they are shown in my system locale language. I've tried…
Aleksandar
  • 3,541
  • 4
  • 34
  • 57
0
votes
3 answers

why is my timestamp converted incorrectly

I'm trying to convert a time stamp in string format to msecs since epoch, like so: QString startTime("20131030 21923"); //2013-10-30 02:19:23 auto date = QDateTime::fromString(startTime, "yyyyMMdd hmmss"); auto secsSinceEpoch =…
LarissaGodzilla
  • 620
  • 2
  • 10
  • 21
0
votes
1 answer

Qt5 summer hour

I create a QDateTime : QDateTime(QDate(1970,01,01), QTime(0,0,0,0)) and when we are in summer hour I would create QDateTime(QDate(1970,01,01), QTime(01,0,0,0)) How know if we are in summer hour or winter hour ?
artoon
  • 729
  • 2
  • 14
  • 41
0
votes
1 answer

Need to know UP/DOWN arrow button is clicked while implementing QDateTimeEdit in Qt?

Need to know UP/DOWN arrow button is clicked while implementing QDateTimeEdit in Qt? I want to catch which button UP/DOWN clicked while changing the time. Please tell me the function which catches this signal. Please reply me fast.
0
votes
1 answer

PQt4 QDatetime: Why do I get the same answer when using addSecs() with two different seconds values?

I'm using Python 2.6.6 and PyQt4. I have a start QDateTime object and I am iteratively adding 60 seconds to create a list of every minute within a given time span. I have discovered that there are several cases where adding two different seconds…
circuitBurn
  • 893
  • 11
  • 24
-2
votes
2 answers

QT optimize program to execute calculations at particular time intervals (Signal & QTimer elapsed)

Hi I have a file with following format where am trying to calculate the position of aircraft from radar (approaching airport) every 10 msecs. Position_X Position_Y Heading Speed t1 t2 w1 t3 w2 t4 Where w1, w2 = turn rate in this case {t1,…
-3
votes
1 answer

Change the specified string to QDateTime

QString timestr("Fri Jan 5 14:03:11 CST 2018"); QDateTime time1 = QDateTime::fromString(timestr, "ddd MMM d hh:mm:ss CST yyyy"); qDebug() << time1.toString("yyyyMMdd"); I try to covert the string to an easier time description, however it failed.…
y.leo
  • 9
1 2 3 4 5
6