File indexing completed on 2024-05-12 05:10:36

0001 /******************************************************************************
0002  * konsolekalendarepoch.h                                                     *
0003  *                                                                            *
0004  * KonsoleKalendar is a command line interface to KDE calendars               *
0005  * SPDX-FileCopyrightText: 2002-2004 Tuukka Pasanen <illuusio@mailcity.com>   *
0006  * SPDX-FileCopyrightText: 2003-2005 Allen Winter <winter@kde.org>            *
0007  *                                                                            *
0008  * SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0 *
0009  *                                                                            *
0010  ******************************************************************************/
0011 
0012 #pragma once
0013 
0014 #include <QDateTime>
0015 
0016 /**
0017  * @file konsolekalendarepoch.h
0018  * Provides the KonsoleKalendarEpoch class definition.
0019  */
0020 
0021 /**
0022  * @brief
0023  * Class for timestamps expressed as epochs.
0024  * @author Allen Winter
0025  */
0026 class KonsoleKalendarEpoch
0027 {
0028 public:
0029     /**
0030      * Constructor.
0031      */
0032     KonsoleKalendarEpoch();
0033 
0034     /**
0035      * Destructor
0036      */
0037     ~KonsoleKalendarEpoch();
0038 
0039     /**
0040      * Converts epoch time to QDateTime format.
0041      * @param epoch epoch time.
0042      */
0043     static QDateTime epoch2QDateTime(uint epoch);
0044 
0045     /**
0046      * Converts QT DateTime to epoch format.
0047      * @param dt is a QDateTime to convert to an epoch.
0048      */
0049     static uint QDateTime2epoch(const QDateTime &dt);
0050 };