PHP Classes

File: ref.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Taha Paksu  >  Ultimate Date Parser  >  ref.txt  >  Download  
File: ref.txt
Role: Documentation
Content type: text/plain
Description: Function Reference
Class: Ultimate Date Parser
Parse and manipulate dates
Author: By
Last change:
Date: 7 years ago
Size: 1,474 bytes


Class file image Download
$date = new dateparser();

Example usage : $date->parseDate("Y-m-d H:i:s","2008-4-24 20:28:34");
Returns : array(	"Year"=>2008,

    Other Functions : 

$date1 and $date2 is date in array format which our first function creates. Returns 1 if first is newer,-1 if second is newer, 0 if they are the exactly same.

$date1 and $date2 are string dates and the $pattern1 $pattern2 is the identifier patterns of them. Produces a new array which contains the difference of year,month,day,hour,minute,second variables in date format.

returns a reformatted date value. for example;

$date->Format("j F Y H:i","Y-m-d H:i:s","2008-04-29 09:44:32") 

returns "29 April 2008 09:44"

Function Localize and generatePattern are internal functions. Localize is not complete yet but I think you can complete it yourself. generatePattern generates RegExp pattern from date patterns for later usage in the parseDate function. All date types which supported in are added to this script.