Jump to content
  • Advertisement
Sign in to follow this  
Tradone

time.h asctime source code?

This topic is 4427 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!