Ronaldo Perez Posted January 15, 2012 Share Posted January 15, 2012 I do not understand call function date("Y d m H i s Z") from test.php - getting the correct value, call the same function from validation.php (from module) - get an incorrect value for the hours, minutes, seconds and timezone .... I do not understand where I'm wrong? Link to comment Share on other sites More sharing options...
justinl Posted January 16, 2012 Share Posted January 16, 2012 My thought is because your prestashop config file or somewhere in the back office you have set the timezone for your shop. When you call date() from test.php, you are not inheriting any controller or config information from the back office (assuming that test is not a controller with a class extending any of prestashops classes/controllers). That's my guess as to why it's showing different values. 1 Link to comment Share on other sites More sharing options...
bellini13 Posted January 16, 2012 Share Posted January 16, 2012 can you post the code from the validation.php, just the line where you call the date function. Link to comment Share on other sites More sharing options...
Ronaldo Perez Posted January 17, 2012 Author Share Posted January 17, 2012 My thought is because your prestashop config file or somewhere in the back office you have set the timezone for your shop. When you call date() from test.php, you are not inheriting any controller or config information from the back office (assuming that test is not a controller with a class extending any of prestashops classes/controllers). That's my guess as to why it's showing different values. Yes, I have had the same thought, probably somewhere set date_default_timezone_set ('tz'); //tz - shop timezone I thought that datetime takes an immutable value of the server, I made a mistake justini, bellini13 - many thanks Link to comment Share on other sites More sharing options...
justinl Posted January 18, 2012 Share Posted January 18, 2012 Glad you managed to resolve your problem Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now