[ create a new paste ] login | about

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

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

long int unix_timestamp()
{
    time_t t = std::time(0);
    long int now = static_cast<long int> (t);
    return now;
}

int main()
{
    long int now = unix_timestamp();
    std::cout << now;
}


Output:
1
1461013984


Create a new paste based on this one


Comments: