Make WordPress Core

Ticket #9272: human_dif_time_test.php

File human_dif_time_test.php, 518 bytes (added by Viper007Bond, 16 years ago)

Test script (drop in WP root)

Line 
1<?php
2
3require( 'wp-load.php' );
4
5$then = strtotime( '2 years 5 months 3 weeks 4 days 7 hours 8 minutes ago' );
6
7// Limit tests
8echo human_time_diff( $then, '', 1 ) . '<br />';
9echo human_time_diff( $then, '', 2 ) . '<br />';
10echo human_time_diff( $then, '', 3 ) . '<br />';
11echo human_time_diff( $then, '', 4 ) . '<br />';
12echo human_time_diff( $then, '', 5 ) . '<br />';
13echo human_time_diff( $then, '', 6 ) . '<br />';
14
15// 30 seconds ago test
16echo '<br />' . human_time_diff( time() - 30, '' );
17
18?>