And replace them with just hardcoded ISO8601 strings and gmtime_r. Pointed out by @laanwj here: #12970 (comment)
Backport of core PR12973 and PR13031
The build for MSVC is left untested and just backported "as-is". AFAIK
we don't support MSVC build and have no plan to do so, but in the event
this should occur in the future that part of code will be ready.