Welcome to mirror list, hosted at ThFree Co, Russian Federation.

timegm.hpp « base - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b5bc0e763d65afe363302b44d61ea5549161c4e3 (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
#pragma once

#include "std/cstdint.hpp"
#include "std/ctime.hpp"

namespace base
{

// Returns true if year is leap (has 29 days in Feb).
bool IsLeapYear(int year);

// Returns number of days for specified month and year.
int DaysOfMonth(int year, int month);

// For some reasons android doesn't have timegm function. The following
// work around is provided.
time_t TimeGM(std::tm const & tm);

// Forms timestamp (number of seconds since 1.1.1970) from year/day/month, hour:min:sec
// year - since 0, for example 2015
// month - 1-jan...12-dec
// day - 1...31
// hour - 0...23
// min - 0...59
// sec - 0...59
time_t TimeGM(int year, int month, int day, int hour, int min, int sec);
} // base