Tom
Tom

Reputation: 1651

Setting a custom system date on the fly for PHP script

We have a script that needs to function between two dates, so to test the script we need to change the UNIX system date to simulate the date conditions.

PROBLEM: The problem is we have other systems running on the same server so we can't just change the UNIX system date.

QUESTION: Is there a way to set the system date on the fly within PHP, for example using ini_set or another method?

Thanks

Upvotes: 0

Views: 308

Answers (1)

Ben
Ben

Reputation: 11188

Why don't you create two timestamps and work with them in your script?

Upvotes: 1

Related Questions