I have a string like this "07:20:30".. How con I converted into a valid time format for hours, minutes and seconds?
Or do I need to parse the string with hardcore code? :\
I have a string like this "07:20:30".. How con I converted into a valid time format for hours, minutes and seconds?
Or do I need to parse the string with hardcore code? :\
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
sscanf?
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Master Dave_Sinkula is the resident sscanf() legend here.. be sure to ask him for help...
It is not who I am inside but what I do that defines me.
sscanf() and mktime() would be my guess.
Unfortunately, there's no portable equivalent to strftime()
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Seems that strftime does the job
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.