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() << "KOrganizer TimezoneId: " << KOPrefs::instance()->mTimeZoneId
00022             << endl;
00023   
00024   time_t ltime;
00025   ::time( &ltime );
00026   tm *t = localtime( &ltime );
00027 
00028   kdDebug() << "localtime: " << t->tm_hour << ":" << t->tm_min << endl;
00029 
00030   kdDebug() << "tzname: " << tzname[0] << " " << tzname[1] << endl;
00031   kdDebug() << "timezone: " << timezone/3600 << endl;
00032   
00033   QTime qtime = QTime::currentTime();
00034   
00035   kdDebug() << "QDateTime::currentTime(): "
00036             << qtime.toString( Qt::ISODate ) << endl;
00037 
00038   kdDebug() << "KLocale::formatTime(): "
00039             << KGlobal::locale()->formatTime( qtime ) << endl;
00040 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:41:10 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001