Replacing Microsoft-only localtime_s function