I am trying to create a program that will display the local time of major city throughout the world. The code that I have written so far is
Code:
//Local time - Determine the local time for the city given in user input
#include <iostream>
#include <cstdlib>
#include <string.h>
#include <cstdio>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// Header to program
cout << "**************************************" << endl;
cout << "**********Local Time Program**********" <<endl;
cout << "**************************************" << endl << endl;
char dateStr [9];
char timeStr [9];
_strdate( dateStr);
// Display the current date and time given on the computer
printf( "The current date is %s \n", dateStr);
_strtime( timeStr );
printf( "The current time is %s \n", timeStr);
cout << endl << endl;
// Ask user for city
string city;
cout << endl << "Enter the city you would like the time for: ";
cin >> city;
}
The problem that I am trying to solve is how to increment or decrement the time based on the time given from the computer.
Thanks in advance for the help.