Dear All,
I can insert data into mysql db already via my C codes. The only problem now I need insert the time in this format "2011-12-11 09:01:02". How can I format this in my C codes? Thank you.

Recommended Answers

man strftime. The format string you need is "%Y-%m-%d %H:%M:%S".

Jump to Post

All 2 Replies

man strftime. The format string you need is "%Y-%m-%d %H:%M:%S".

Dear Nezachem,
So normally in C if I put %d then at the end I must put a variable corresponding to it right? So will it be in this case?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.