Can anyone tell me how to calculate yesterday's date using c++?
Jovanie_1
0
Newbie Poster
Recommended Answers
Jump to PostThe calculations are unnecessary.
mktime
can be used to normalize the contents of atm
structure to the correct date and time after manual modifications.#include <iostream> #include <ctime> using namespace std; int main() { time_t now = time(0); tm *date = localtime(&now); --date->tm_mday; // …
All 2 Replies
AssertNull
1,094
Practically a Posting Shark
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
AssertNull
commented:
I like this approach.
+5
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.