I'm trying to see if I can grab the time and timezone from the system and then output the information to the user and also a modified time with hours++ and hour-- aswell as minute++ and minute--
I researched and found many tutorials and forums with helpful information but I was never able to run their sample codes using the Visual C++ 2008 compiler.
But i think that CTIME is what I'm looking for maybe the localtime() function. But what I don't really understand is how to tweak the time. Will i be able to pass the hours, minutes into variables?
Not asking for complete code (but would be greatly appreaciated) but some help in how to start my program.
I have to impliment them into classes, so I have this written up so far
class Time
{
int time
int hours;
int minutes;
public:
void setTime(int, int);
void returnTime(int, int);
string printTime();
void incrementHour();
void incrementMinute();
timeClass();
{
cout << "The time has been adjusted" << endl;
}
~timeClass();
};
class extTime: Time
{
string time_zone;
public:
void setTime(int, int);
void returnTime(int, int);
string printTime();
void incrementHour();
void incrementMinute();
string printTimeZone();
later on i'll just pass the information into the main() function. But right now I just a little nudge in the right direction.
Question
saiya
Hi,
I'm trying to see if I can grab the time and timezone from the system and then output the information to the user and also a modified time with hours++ and hour-- aswell as minute++ and minute--
I researched and found many tutorials and forums with helpful information but I was never able to run their sample codes using the Visual C++ 2008 compiler.
But i think that CTIME is what I'm looking for maybe the localtime() function. But what I don't really understand is how to tweak the time. Will i be able to pass the hours, minutes into variables?
Not asking for complete code (but would be greatly appreaciated) but some help in how to start my program.
I have to impliment them into classes, so I have this written up so far
class Time
{
int time
int hours;
int minutes;
public:
void setTime(int, int);
void returnTime(int, int);
string printTime();
void incrementHour();
void incrementMinute();
timeClass();
{
cout << "The time has been adjusted" << endl;
}
~timeClass();
};
class extTime: Time
{
string time_zone;
public:
void setTime(int, int);
void returnTime(int, int);
string printTime();
void incrementHour();
void incrementMinute();
string printTimeZone();
later on i'll just pass the information into the main() function. But right now I just a little nudge in the right direction.
Thanks
}
Link to comment
Share on other sites
6 answers to this question
Recommended Posts