JDate

From Joomla! Documentation
(Difference between revisions)
Jump to: navigation, search
(Bulk upload by Doxiki2)
Line 1: Line 1:
===Availability===
+
This class is available in the following Joomla versions:-
{{JVer|1.5}}
+
<splist showpath=notparent />
 
+
<noinclude>[[Category:Framework]][[Category:JDate]]</noinclude>
===Defined in===
+
/libraries/joomla/utilities/date.php
+
 
+
===Extends===
+
* {{JVer|1.5}} [[JObject]]
+
* {{JVer|1.6}} [http://www.php.net/manual/en/class.datetime.php PHP DateTime]
+
 
+
===Importing===
+
<source lang="php">jimport( 'joomla.utilities.date' );</source>
+
 
+
===Examples===
+
====Difference between two Dates====
+
<source lang="php">
+
jimport( 'joomla.utilities.date' );
+
 
+
$datenow = new JDate();
+
$dateold = new JDate( $row->publish_down );
+
 
+
$row = // row from Database whith publish_down as column e.g. #__content
+
 
+
if( $datenow->toUnix() > $dateold->toUnix() ) {
+
  echo "Actual";
+
} else {
+
  echo "Out of Date";
+
}
+
</source>
+

Revision as of 16:25, 17 April 2011

This class is available in the following Joomla versions:-

Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox