Friday, August 18, 2017

Get current time formatted day/month/year in php – PHP snippet

If you wish to format the current date in format day/month/year just copy the function bellow and use it where you want. function nogettime(){ return date('d/m/Y', time()); // this display the...

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; ...

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 Difference Between Two Times

The following function will help you get the difference from two dates in PHP. You need to specify the 2 dates when you call the function in PHP. function dateDifffun($date1, $date2){ ...

Calculate Age of somebody in PHP

If you wish a function to calculate age of a person/car or whatever you want you have come to the right place. The following function will calculate age from a specific...

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...