hi all......
Can you explain me how to get local timestamp in C++.
regards wijitha.
wijitha 0 Newbie Poster
Recommended Answers
Jump to Postsee the functions in time.h -- such as time(0) will return the current time in seconds since 1970 (or something like that). Then localtime() will convert it to a structure tm. There is also a gmtime() that converts the time(0) to GMT instead of local time.
Jump to Posthi...
i want to get local time stamp in format mmddhhmmsshh where last hh gives the hundreds of seconds.
if you have any idea reply me.
regards
wijithaThe functions in time.h will not give you milliseconds. For that you need to call other os-specific functions. For MS-Windows you can …
All 5 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Salem commented: Nice succinct answer +12
wijitha 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Jishnu 160 Posting Pro
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.