summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/TimeUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/utils/TimeUtils.h')
-rw-r--r--xbmc/utils/TimeUtils.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/xbmc/utils/TimeUtils.h b/xbmc/utils/TimeUtils.h
new file mode 100644
index 0000000..078753e
--- /dev/null
+++ b/xbmc/utils/TimeUtils.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include <stdint.h>
12#include <string>
13#include <time.h>
14
15class CDateTime;
16
17int64_t CurrentHostCounter(void);
18int64_t CurrentHostFrequency(void);
19
20class CTimeUtils
21{
22public:
23
24 /*!
25 * @brief Update the time frame
26 * @note Not threadsafe
27 */
28 static void UpdateFrameTime(bool flip);
29
30 /*!
31 * @brief Returns the frame time in MS
32 * @note Not threadsafe
33 */
34 static unsigned int GetFrameTime();
35 static CDateTime GetLocalTime(time_t time);
36
37 /*!
38 * @brief Returns a time string without seconds, i.e: HH:MM
39 * @param hhmmss Time string in the format HH:MM:SS
40 */
41 static std::string WithoutSeconds(const std::string hhmmss);
42private:
43 static unsigned int frameTime;
44};
45