Questions related to time and date in C.
Hello, I have 2 questions related to time and date in the C Programming Language.
Here: 1. How can I translate the output from time(NULL); to the human readable time and (if possible) date? 2. How can I get the date and time from the BIOS or the Hardware Clock and if needed translate it to human readable time and date? Help would be appreciated. :) Also, I am really happy with LinuxQuestions.org. It is the only place to ask Linux and Programming Stuff for me because people at my country don't use linux or program. :) |
http://www.codingunit.com/c-tutorial...-and-date-in-c
ctime() mktime() console: Code:
# man ctime |
or: localtime + strftime
|
A quick example:
Code:
time_t mytime; |
How 'bout: how do I convert the Human Readable time and date in a format and convert it to Epoch. Thanks all. :)
|
It is already in a format, and what do you mean by 'Epoch'?
PS: strptime is your friend. |
All times are GMT -5. The time now is 03:28 AM. |