Solved

Get the Date

Posted on 1997-12-15
3
189 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

807 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