[ create a new paste ] login | about

Link: http://codepad.org/uTC5KjnF    [ raw code | output | fork ]

C++, pasted on Jun 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <ctime>

int main(){
int time1 = 123456789;

std::time_t m = static_cast<time_t>(time1);

std::tm tm = *std::localtime(&m);

tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;

time_t timeSinceEpoch = mktime(&tm);
std::cout << timeSinceEpoch << std::endl;
}


Output:
1
123379200


Create a new paste based on this one


Comments: