Time API fixes

Time API fixes

Tests before these patches: 175 Fails

Tests after these patches: 101 Fails