943,840 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 1609
  • C++ RSS
Dec 17th, 2008
0

Get weekday Name VC++

Expand Post »
Hi

How to get WeekdayName in VC++

I have searched on net and found the use of
CTime::GetCurrentTime();

But this is the lengthy method

Is there any shorter one.

Kindly advice

Regards
Karan
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
karang is offline Offline
46 posts
since Jul 2008
Dec 17th, 2008
0

Re: Get weekday Name VC++

Your question is a bit bizzare. What do you mean by week name?

But perhaps this would be helpful
http://www.cplusplus.com/reference/c...localtime.html

Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Dec 17th, 2008
0

Re: Get weekday Name VC++

Hi Chris

For Example today is wednesday.

How can I get the Week day Name i.e. Sunday, Monday ... from VC++

Regards
Karan
Reputation Points: 10
Solved Threads: 0
Light Poster
karang is offline Offline
46 posts
since Jul 2008
Dec 17th, 2008
0

Re: Get weekday Name VC++

oh the day of the week, my bad. Either way i'm sure you could have adapted the information given by that webpage it's not too complex.
C++ Syntax (Toggle Plain Text)
  1. #include <iostream>
  2. #include <ctime>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main (void){
  8. time_t rawtime;
  9. struct tm * timeinfo;
  10.  
  11. time ( &rawtime );
  12. timeinfo = localtime ( &rawtime );
  13. string day(asctime (timeinfo));
  14. cout << "Date: " << day.substr(0, day.find_first_of(" "));
  15.  
  16. cin.get();
  17. return 0;
  18. }
Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Need help with tickts program
Next Thread in C++ Forum Timeline: Date Format





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC