Ninjakreborn Posted August 20, 2012 Share Posted August 20, 2012 I know if your working on something locally you can time forward your PC to make it seem like it's a different date/time. What happens fi your working on a server though. Is there a way to make PHP think your current date/time is different than what it is. Like a way to set the current date/time that PHP thinks your on? Perhaps a global setting to hardcode the date/time for a script. So if you want the script to think it's currently....3:00 A.M. on 8/20/2012 is there a way to do that without having to pull the files locally and time forward your system? Quote Link to comment https://forums.phpfreaks.com/topic/267334-fake-datetime-on-php-script/ Share on other sites More sharing options...
ManiacDan Posted August 20, 2012 Share Posted August 20, 2012 Is there any particular reason you WANT to do this? All date/time functions accept a timestamp as an argument. If one is not provided, it uses "now." You could write your script to have a test flag which will override the value of every date function. Quote Link to comment https://forums.phpfreaks.com/topic/267334-fake-datetime-on-php-script/#findComment-1370809 Share on other sites More sharing options...
Ninjakreborn Posted August 20, 2012 Author Share Posted August 20, 2012 I have a project i'm working on a server. The client is able to pull down from his system and time forward stuff (fantasy sports). So me testing is a little tricky, since i'm working on the server (replacement laptop). I found an alternative for now, but curious if there was a way to do that. Quote Link to comment https://forums.phpfreaks.com/topic/267334-fake-datetime-on-php-script/#findComment-1370816 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.