How can I convert a date string such as dd.mm.yyyy or mm/dd/yyyy to time_t? I've spent many, many hours trying all sorts of stuff and googling, but I have been unable to find or program a function that does this. The tm struct needs way too much information. I simply want to be able know the difference between a given date and 1.1.1970 in seconds.
The boost date-time library seemed to offer some functions for this kind of stuff, but I got some linker errors that I was unable to fix.
If you got linker errors, you probably aren't linking the Boost libraries. In any case, if you want to use the tm struct, you can probably just pass 0s for the very precise times as you don't really need that much precision.
That's right, I wasn't linking some libraries but I couldn't find out how I could do that either (it required lots of files/stuff I'm completely unfamiliar with and the instructions were confusing to me). So I guessed there probably is an easier way of doing this that I haven't found out.
The tm struct was the first thing I tried and I indeed did put zeros for the hours, minutes etc., but the fields where the problems arise are the more bizarre ones such as "Days since sunday" and "Days since January 1". I would have to do some calculations to get these fields and I would have to take for example leap years into account, so again I was thinking that there should be a better way.