Get weekday Name VC++

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2008
Posts: 46
Reputation: karang is an unknown quantity at this point 
Solved Threads: 0
karang karang is offline Offline
Light Poster

Get weekday Name VC++

 
0
  #1
Dec 17th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 671
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Get weekday Name VC++

 
0
  #2
Dec 17th, 2008
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
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 46
Reputation: karang is an unknown quantity at this point 
Solved Threads: 0
karang karang is offline Offline
Light Poster

Re: Get weekday Name VC++

 
0
  #3
Dec 17th, 2008
Hi Chris

For Example today is wednesday.

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

Regards
Karan
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 671
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Get weekday Name VC++

 
0
  #4
Dec 17th, 2008
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.
  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
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC