base::Time::FromUTCExploded() and base::Time::FromLocalExplode() can fail.
Callers do not seem to be aware of this, nor is it clear from the API how to test for the failure.
This has led to a number of broken callsites that use a pattern similar to:
----------------
if (!exploded.HasValidValues())
return false;
time = base::Time::FromUTCExploded(exploded);
return true
----------------
HasValidValues() does not guarantee success of FromUTCExploded(), and this pattern can lead to consuming an ill-defined time.
On failure, the Windows implementation may return Time(0).
Comment 1 by eroman@chromium.org
, Apr 8 2016