in reply to Testing and database date functions
To solve a similar problem, I wrote code to allow an environment variable to override the current date and time. The Perl code would use the real current time if the environment variable was unset, or would use the one from the environment if it was set. This did require some changes to the Perl code, but worked pretty well, and I can test how the code would work on different dates by changing the environment variable.
Another possibility worth investigating is abusing time zones. Some systems will let you set a timezone offset of something like "72 hours" which will make the date appear forward or backwared a 3 days. If your database has some notion of per-connection timezones, a trick like that could work.
|
|---|