Convert a string to a date in C++


Question

I know this may be simple but being C++ I doubt it will be. How do I convert a string in the form 01/01/2008 to a date so I can manipulate it? I am happy to break the string into the day month year constituents. Also happy if solution is Windows only.

1
19
2/17/2012 8:47:54 AM

#include <time.h>
char *strptime(const char *buf, const char *format, struct tm *tm);
16
11/21/2008 10:46:56 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon