Sign in to follow this  

time.h asctime source code?

This topic is 4271 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Basically, if I have the following source code..
	struct tm *ptr;
	time_t lt;
	lt = time(NULL);
	ptr=localtime(<);
	std::cout << asctime(ptr);


and I would like to convert the time in a different format from asctime, I would like to know where I can see the source code for asctime so that I can make my own time conversion function. edit: I did try google for the source code but it seems like time.h's corresponding cpp file is in a *.o file and thus the source code isn't availble in the open.... [Edited by - Tradone on May 8, 2006 12:19:53 PM]

Share this post


Link to post
Share on other sites
You don't really need the source code for asctime to create a time conversion function. Just look at the definition for struct tm. By knowing what fields are available in the structure, you can easily work out any format conversions you want.

Share this post


Link to post
Share on other sites

This topic is 4271 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this