aboutsummaryrefslogtreecommitdiffstats
path: root/src/libdash/source/helpers/Time.cpp
blob: e6ca2b812d7b9493f6267d57ce9ae84ca616fa77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Time.cpp
 *****************************************************************************
 * Copyright (C) 2013, bitmovin Softwareentwicklung OG, All Rights Reserved
 *
 * Email: libdash-dev@vicky.bitmovin.net
 *
 * This source code and its use and distribution, is subject to the terms
 * and conditions of the applicable license agreement.
 *****************************************************************************/

#include "Time.h"

using namespace dash::helpers;

uint32_t    Time::GetCurrentUTCTimeInSec   ()
{
    return mktime(Time::GetCurrentUTCTime());
}
std::string Time::GetCurrentUTCTimeStr   ()
{
    char timeString[30];
    strftime(timeString, 30, "%Y-%m-%dT%H:%M:%SZ", Time::GetCurrentUTCTime());

    return std::string(timeString);
}
struct tm*  Time::GetCurrentUTCTime     ()
{
    time_t      rawTime;

    time(&rawTime);
    return gmtime(&rawTime);
}