Skip to content

Tag: datetime

Separate date to several intervals

I’ve got an array like the following : And another array : I would like to create a new $array3 that removes the intervals from $array2 in $array1 to give the following result : As you can see, in $array3 2 new entries were added to remove the interval used in $array2. I don’t know how can I tackl…

Date conversion in PHP

I have date in the following format – I want convert this date using php in the following format – I tried following ways so far but id didn’t work – There are many questions already available for date conversion on stack overflow itself but none of them answer my question as my date t…

How to retrieve Mysql data from todays date using PHP

I am using the PHP time() function to get the current time and Insert it into the database. I can also retrieve date by setting the value in a variable and doing something like: date(Y-m-d, $time) But now I want to get a result from the Database on the current date compared to the time inserted in the Databas…

limit a form submission – once in two minutes

I want to limit a form submission – once in two minutes time of last attempt is in a session variable something like this: pls help to write this code properly Answer Try something like this… Check the DateInterval class for more details.