Exemplo n.º 1
0
 public function get_date_range()
 {
     return date_range_string($this->start_date, $this->end_date);
 }
Exemplo n.º 2
0
<p>Formats a date for the database in (yyyy-mm-dd hh:mm:ss) format. If a value is left out, it will return the current date/time value for that slot.</p>
<pre class="brush: php">
format_db_date(2010, 1, 1, 12, 10, 10);
// returns <?php 
echo format_db_date(2010, 1, 1, 12, 10, 10);
?>
</pre>


<h2>date_range_string(<var>date1</var>, <var>date2</var>)</h2>
<p>Creates a date range string (e.g. January 1-10, 2010).</p>

<pre class="brush: php">
date_range_string('2010-08-01', '2010-08-05');
// returns <?php 
echo date_range_string(time() - 24 * 60 * 60, time());
?>
</pre>


<h2>pretty_date(<var>timestamp</var>, <var>use_gmt</var>)</h2>
<p>Creates a string based on how long from the current time the date provided.</p>

<pre class="brush: php">
pretty_date(time() - (60 * 60));
// returns <?php 
echo pretty_date(time() - 60 * 60);
?>
</pre>

Exemplo n.º 3
0

<h2>format_db_date(<var>[y]</var>, <var>[m]</var>, <var>[d]</var>, <var>[h]</var>, <var>[i]</var>, <var>[s]</var>)</h2>
<p>Formats a date for the database in (yyyy-mm-dd hh:mm:ss) format. If a value is left out, it will return the current date/time value for that slot.</p>
<pre class="brush: php">
format_db_date(2010, 1, 1, 12, 10, 10);
// returns <?=format_db_date(2010, 1, 1, 12, 10, 10)?>
</pre>


<h2>date_range_string(<var>date1</var>, <var>date2</var>)</h2>
<p>Creates a date range string (e.g. January 1-10, 2010).</p>

<pre class="brush: php">
date_range_string('2010-08-01', '2010-08-05');
// returns <?=date_range_string((time() - (24*60*60)), time())?>
</pre>


<h2>pretty_date(<var>timestamp</var>, <var>use_gmt</var>)</h2>
<p>Creates a string based on how long from the current time the date provided.</p>

<pre class="brush: php">
pretty_date(time() - (60 * 60));
// returns <?=pretty_date(time() - (60 * 60))?>
</pre>


<h2>get_age(<var>bday_ts</var>, <var>[at_time_ts]</var>)</h2>
<p>Returns an age based on a given date/timestamp. The second parameter is optional and by default will be the current date.</p>