Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Get the Date

Posted on 1997-12-15
3
Medium Priority
?
204 Views
Last Modified: 2010-04-10
How do I get the date? I want the number of the current day storaged in a integer.
0
Comment
Question by:sshulo
3 Comments
 
LVL 5

Expert Comment

by:yonat
ID: 1176343
try gmtime() or localtime()
0
 
LVL 7

Accepted Solution

by:
galkin earned 30 total points
ID: 1176344
If you are using Visual C++ you can take advantage of MFC CTime class.

CTime time = CTime::CurrentTime();

Than you can use CTime members GetDay(), GetHour() etc. to get all time parameters
0
 

Author Comment

by:sshulo
ID: 1176345
Thanx..but to create an CTime object the code should look like this:
CTime time = CTime::GetCurrentTime();



0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question