I want to perform something in my php web service when it is midnight i.e. current time is 24:00:00 / 00:00:00
How can I do that ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use localtime() in order to fetch current time of day, and then work on that using an if statement.
Eg.
Keep in mind that this only works on script that is continually executed (eg. index.php), if you want a script to execute regardless of whether it’s currently being executed at the desired time, you need to use chron jobs.