Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extracting date from system date in c++ 1

Status
Not open for further replies.

palreddy

Programmer
Jan 19, 2001
9
0
0
US
hey folks,
I need the date from system date..for example if today is
sun Dec 09 2001 ..i want '09'(just todays date and not day month or year) from the system date string.kinda urgent plzzz......
your help would be appreciated.

thanks,
pradeep
 
#include <iostream>
#include <ctime>

int main()
{
char sDate[50];
char sDay [3];
time_t theTime;

time( &theTime );
strcpy( sDate,asctime( localtime( &theTime ) ) );

sDay[0] = sDate[8];
sDay[1] = sDate[9];
sDay[2] = '\0';

std::cout << &quot;The day is: &quot;
<< sDay <<
std::endl;

return 0;

} Mike L.G.
mlg400@blazemail.com
 
hey mike,
I was wondering if I cud get code for drawing a
solid or hollow circle.I mean solid means it shud be filled with chaarcter like * or watever character...and hollow means outline shud be formed by a char like *...am loooking for a for loop kinda deal than with formula of a circle...
thanks mike.
--Pradeep
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top