korganizer Library API Documentation

timezone.cpp

00001 #include <time.h> 00002 00003 #include <qdatetime.h> 00004 00005 #include <kaboutdata.h> 00006 #include <kapplication.h> 00007 #include <kdebug.h> 00008 #include <klocale.h> 00009 #include <kcmdlineargs.h> 00010 #include <kglobal.h> 00011 00012 #include "koprefs.h" 00013 00014 int main(int argc,char **argv) 00015 { 00016 KAboutData aboutData("timezone",I18N_NOOP("KOrganizer Timezone Test"),"0.1"); 00017 KCmdLineArgs::init(argc,argv,&aboutData); 00018 00019 KApplication app; 00020 00021 kdDebug(5850) << "KOrganizer TimezoneId: " << KOPrefs::instance()->mTimeZoneId 00022 << endl; 00023 00024 time_t ltime; 00025 ::time( &ltime ); 00026 tm *t = localtime( &ltime ); 00027 00028 kdDebug(5850) << "localtime: " << t->tm_hour << ":" << t->tm_min << endl; 00029 00030 kdDebug(5850) << "tzname: " << tzname[0] << " " << tzname[1] << endl; 00031 kdDebug(5850) << "timezone: " << timezone/3600 << endl; 00032 00033 QTime qtime = QTime::currentTime(); 00034 00035 kdDebug(5850) << "QDateTime::currentTime(): " 00036 << qtime.toString( Qt::ISODate ) << endl; 00037 00038 kdDebug(5850) << "KLocale::formatTime(): " 00039 << KGlobal::locale()->formatTime( qtime ) << endl; 00040 }
KDE Logo
This file is part of the documentation for korganizer Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:58:14 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003