assuming that the string is constant, and you're using ctime
http://www.cplusplus.com/reference/clibrary/ctime/ctime/
The returned string has the following format:
Www Mmm dd hh:mm:ss yyyy
Where Www is the weekday, Mmm the month in letters, dd the day of the month, hh:mm:ss the time, and yyyy the year. |
output is a string, so basically you access the Mmm, dd and yyyy char, and manipulate them.
with the month, use a series of if-else/switch statements to tell the number of days. for example, if the month is jan, mar or may, then day=31
with the days, take the first digit, change to int (using arithmetic or functions), multiply by 10, then add with the second digit. for example, if its the 21st, we take in '2', change to int, multiply by 10 to get 20. then we add up the second digit, 1 to get 21. note that the output is string, so its in an array of characters.
well, thats just my way. possible for other simpler solutions. hope this helps :D