Vivek Vishwakarma
Vivek Vishwakarma

Reputation: 89

How To store Value form QDateEdit in String?

I want to store value from QDateEdit to String. I'have used following code:

QString str = ui->dateeditobject->date().toString("dd/mm/yyyy")

But the problem is, that the month value is not being stored as you can see in the picture.

Where am I going wrong?

Upvotes: 1

Views: 4586

Answers (1)

Davy
Davy

Reputation: 470

Month is MM (uppercase), otherwise it is minutes

ui->dateeditobject->date().toString("dd/MM/yyyy")

Documentation here.

Upvotes: 6

Related Questions