Fix crashes when localtime() can't handle the date.
Buildfix for missing functions on Android/win32.
Quick fix rtc crash, probably gives wrong results.
Merge pull request #495 from unknownbrackets/rtc-fix

RTC buildfix (but not sure)