Solved

Get the Date

Posted on 1997-12-15
3
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

632 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