PHP Find time ago between two times

/** * Formats a timestamp nicely with an adaptive "x units of time ago" message. * Only handles past dates. * @return string Nicely-formatted message for the timestamp. * @param $time Output of strtotime() on your choice of timestamp. */ function ago($time) { $time = strtotime($time); $delta = time() – $time; if ($delta < 60) […]
Continue reading…

Enjoyed this post? Share it!

 
 

Using Localtime()

  <?php $a = localtime(); $a[4] += 1; $a[5] += 1900; print "$a[4]/$a[3]/$a[5]";
Continue reading…

Enjoyed this post? Share it!

 
 

Offsets From Utc

  $pc_timezones = array( ‘GMT’ => 0, // Greenwich Mean ‘UTC’ => 0, // Universal (Coordinated) ‘WET’ => 0, // Western European ‘WAT’ => -1*3600, // West Africa ‘AT’ => -2*3600, // Azores ‘NFT’ => -3*3600-1800, // Newfoundland ‘AST’ => -4*3600, // Atlantic Standard ‘EST’ => -5*3600, // Eastern Standard ‘CST’ => -6*3600, // Central […]
Continue reading…

Enjoyed this post? Share it!