Category : ctime

I’m running a simple Python script that loops through a bunch of text files and gets the date and time that the file was created. It does this with this line of code: file_date = time.ctime(os.path.getctime(current_file)) The problem is that my workflow spans two OS’s and that screws up the understanding of when the date/time ..

Read more

#include <iostream> #include <string> #include <ctime> #include <vector> #include <sstream> using namespace std; #define LOG(x) cout << x << endl class Date { private: string date; string time; string day; string month; string year; string WeekylQuote; public: void TimeReadFromSystem(string &str) //this function read time of system { time_t my_time = time(NULL); } void StorerOfAscTimeIntoVariables(const string ..

Read more

#include <iostream> #include <ctime> using namespace std; int main() { double seconds; struct tm birth = {0}; //10-28-1955 birth.tm_year = 55; birth.tm_mon = 9; birth.tm_mday = 28; birth.tm_sec = 0; struct tm present = {0}; //2-10-2021 present.tm_year = 121; present.tm_mon = 1; present.tm_mday = 10; present.tm_sec = 0; time_t p1 = mktime(&present); time_t b1 = ..

Read more