Monday, June 26, 2017

Check If A Date Is In The Past Or In The Future in PHP

The following code will help you to check if a date in the future or in the past. Where are this required? A lot of fields date will require you to...

Get the Week Number From A Date in PHP

When you code maybe you find difficult to get the week number from a date. Maybe you think of some particular dates and how will you get an algorithm ready for...

Show A List Of Days Between Two Dates in PHP

The following function will show you a list of days between two dates. The following code will require to setup a start date on variable $start and a end date on variable...

Countdown To A Date in PHP

If you wish a script in PHP that will countdown the time you can use the following code: $dtt_end = new DateTime('January 3, 2030 2:00 PM'); // the date to count down $remain...

Twitter Style “Time Ago” Dates on PHP

The following function will show the time like Twitter with that info ago, like 9 hours ago: function _agotime($tm,$rcs = 0) { $cur_tm = time(); $dif = $cur_tm-$tm; ...

Convert minutes to hours and minutes or seconds to minutes and seconds

If you wish to convert minutes to hours and minutes display or convert minutes to minutes and second display here is a super useful function to do so: function convertTo($time, $format =...