timezone.cpp
00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 #include <time.h> 00025 00026 #include <tqdatetime.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 TQTime qtime = TQTime::currentTime(); 00057 00058 kdDebug(5850) << "TQDateTime::currentTime(): " 00059 << qtime.toString( TQt::ISODate ) << endl; 00060 00061 kdDebug(5850) << "KLocale::formatTime(): " 00062 << KGlobal::locale()->formatTime( qtime ) << endl; 00063 }