Making a PHP/MySQL Timestamp look more attractive
问题 So basically, I'm currently selecting a Timestamp from my MySQL database. In the database, the timestamp looks like so: 2010-06-30 12:36:08 Obviously for a webapp, that's not very attractive for users to view. So, using some CodeIgniter functions, I made it look a bit nicer. <h4 class="timestamp"> <?php // Quickly calculate the timespan $post_date = mysql_to_unix($row->date); $now = time(); echo timespan($post_date, $now);?> ago </h4> If you don't do CodeIgniter, everything's standard PHP