korganizer
timezone.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <time.h>
00025
00026 #include <qdatetime.h>
00027
00028 #include <kaboutdata.h>
00029 #include <kapplication.h>
00030 #include <kdebug.h>
00031 #include <klocale.h>
00032 #include <kcmdlineargs.h>
00033 #include <kglobal.h>
00034
00035 #include "koprefs.h"
00036
00037 int main(int argc,char **argv)
00038 {
00039 KAboutData aboutData("timezone",I18N_NOOP("KOrganizer Timezone Test"),"0.1");
00040 KCmdLineArgs::init(argc,argv,&aboutData);
00041
00042 KApplication app;
00043
00044 kdDebug(5850) << "KOrganizer TimezoneId: " << KOPrefs::instance()->mTimeZoneId
00045 << endl;
00046
00047 time_t ltime;
00048 ::time( <ime );
00049 tm *t = localtime( <ime );
00050
00051 kdDebug(5850) << "localtime: " << t->tm_hour << ":" << t->tm_min << endl;
00052
00053 kdDebug(5850) << "tzname: " << tzname[0] << " " << tzname[1] << endl;
00054 kdDebug(5850) << "timezone: " << timezone/3600 << endl;
00055
00056 QTime qtime = QTime::currentTime();
00057
00058 kdDebug(5850) << "QDateTime::currentTime(): "
00059 << qtime.toString( Qt::ISODate ) << endl;
00060
00061 kdDebug(5850) << "KLocale::formatTime(): "
00062 << KGlobal::locale()->formatTime( qtime ) << endl;
00063 }
|