Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get the Date

Posted on 1997-12-15
3
Medium Priority
?
201 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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 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.

688 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