Created
January 7, 2020 08:32
-
-
Save HamedMasafi/eb4b4333c429a08ce5a8f7508b4866ae to your computer and use it in GitHub Desktop.
QCalendar and jalali calendar in Qt 5.14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QCoreApplication> | |
#include <QCalendar> | |
#include <QDate> | |
#include <QDebug> | |
int main(int argc, char *argv[]) | |
{ | |
QCoreApplication a(argc, argv); | |
QCalendar cal(QLatin1String("jalali")); | |
qDebug() << "availableCalendars=" << QCalendar::availableCalendars(); | |
QString todayJalali = QDate::currentDate().toString("yyyy-MM-dd", cal); | |
qDebug() << "Today in jalali calendar=" << todayJalali; | |
QDate d(1398, 10, 15, cal); | |
qDebug() << "Date 1398/10/15 in julian calendar=" << d.toString(); | |
return a.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment