korganizer

timezone.cpp
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23 */
24 #include <time.h>
25 
26 #include <tqdatetime.h>
27 
28 #include <tdeaboutdata.h>
29 #include <tdeapplication.h>
30 #include <kdebug.h>
31 #include <tdelocale.h>
32 #include <tdecmdlineargs.h>
33 #include <tdeglobal.h>
34 
35 #include "koprefs.h"
36 
37 int main(int argc,char **argv)
38 {
39  TDEAboutData aboutData("timezone",I18N_NOOP("KOrganizer Timezone Test"),"0.1");
40  TDECmdLineArgs::init(argc,argv,&aboutData);
41 
42  TDEApplication app;
43 
44  kdDebug(5850) << "KOrganizer TimezoneId: " << KOPrefs::instance()->mTimeZoneId
45  << endl;
46 
47  time_t ltime;
48  ::time( &ltime );
49  tm *t = localtime( &ltime );
50 
51  kdDebug(5850) << "localtime: " << t->tm_hour << ":" << t->tm_min << endl;
52 
53  kdDebug(5850) << "tzname: " << tzname[0] << " " << tzname[1] << endl;
54  kdDebug(5850) << "timezone: " << timezone/3600 << endl;
55 
56  TQTime qtime = TQTime::currentTime();
57 
58  kdDebug(5850) << "TQDateTime::currentTime(): "
59  << qtime.toString( TQt::ISODate ) << endl;
60 
61  kdDebug(5850) << "TDELocale::formatTime(): "
62  << TDEGlobal::locale()->formatTime( qtime ) << endl;
63 }