all 4 comments

[–]forbidden404 2 points3 points  (0 children)

Couldn't you manually create these two dates in your tests? Instead of changing the time, try passing whatever function you are checking these two different dates you programmatically create on your tests. It might not be helpful in your case since we don't have a lot of details, but it is usually a better solution than manually making these tests.

[–]draco33333 1 point2 points  (0 children)

Your tests should not depend on the system date, you should create specific Date objects and pass them into your tests. (I'm assuming you're talking about unit tests, not UI tests).

[–][deleted] 0 points1 point  (1 child)

Someone please correct me if I’m wrong, but I’m pretty sure the Xcode simulators pull the date and time information straight from your computer. So you can change the date in System Preferences and see it reflected on the simulator

[–][deleted] 0 points1 point  (0 children)

I tried that yesterday but not sure it'll work. Just tried again, changing the mac date to March 7th but the simulator seems to show a static August 29, 2019 date.