Check date with C++ -
i check if current date specific set date, , if date correct, run code block. else end script. i'm thinking, this:
int/string? date = ????; if(date==10/07/13){ } else return 0;
i have variable named date, current date. issues see having slashes within it. also, add writing on english windows 7 computer, , opened on dutch windows 7 computer.. issue?
this should started:
#include <ctime> #include <iostream> int main() { std::time_t tp = std::time(null); // current time, integer // counting seconds since epoch std::tm * ts = std::localtime(&tp); // parsed human conventions std::cout << "year: " << 1900 + ts->tm_year << "\n" << "month: " << ts->tm_mon << "\n" << "day: " << ts->tm_mday << "\n" ; }
instead of localtime
(which uses current locale) can use gmtime
time in utc.
Comments
Post a Comment