#include <iostream>
#include <ctime>
int TimeInMillisecondsToNumberOfYears(long milliseconds) {
// Get current time
std::time_t t = milliseconds / 1000; // Convert milliseconds to seconds
std::tm* cal = std::gmtime(&t);
int totalyears = cal->tm_year + 1900 - 1970;
int year = cal->tm_year + 1900;
std::cout << year << std::endl;
return totalyears;
}
int main() {
long milliseconds = 1476907455894L;
int totalyears = TimeInMillisecondsToNumberOfYears(milliseconds);
std::cout << totalyears << std::endl;
}
/*
run:
2016
46
*/