Add Utils::DateTime::currentDate()
ClosedPublic

Authored by dfaure on Apr 28 2018, 1:54 PM.

Details

Summary

We'll see if currentDateTime() can be removed in the end, once
everything works with dates only.

Test Plan

compiles, unittest passes

Diff Detail

Repository
R4 Zanshin
Branch
currentDate (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure requested review of this revision.Apr 28 2018, 1:54 PM
dfaure created this revision.

Shouldn't we reuse the ZANSHIN_OVERRIDE_DATETIME environment variable here? Just to avoid situations where currentDate() and currentDateTime() are out of sync because the two variables aren't properly set?

Maybe once the transition is done we can switch to a single ZANSHIN_OVERRIDE_DATE variable indeed, but that feels a bit early here.

I don't want to risk timezone issues with datetimes resolving to a different day, and that would require another commit to convert from DATETIME to DATE everywhere.
If you prefer I can discard this and bundle the DATETIME=>DATE change into the upcoming big commit (which is about QDateTime=>QDate change everywhere)

ervin accepted this revision.Apr 29 2018, 12:21 PM

OK, I see. I'd rather have smaller commits, so let's go for the two variables. It's supposed to be transitional anyway.

This revision is now accepted and ready to land.Apr 29 2018, 12:21 PM
dfaure closed this revision.Apr 30 2018, 10:36 AM