Class Date
Provides text filters for date objects
This class should be cleaned up quite a bit, and it needs to be made pluggable so that it can be used by languages other than English. But, I think right now it is good enough to be released because it falls into "special sauce" rather than necessary functionality.
Namespace: Alphred
Todo: Abstract the time dictionaries so that they can be translated
Todo: Add in a less precise version of "seconds to human time"
Todo: Make these work with dates before Jan 1, 1970
Located at Date.php
Todo: Abstract the time dictionaries so that they can be translated
Todo: Add in a less precise version of "seconds to human time"
Todo: Make these work with dates before Jan 1, 1970
Located at Date.php
Methods summary
private
array
|
#
diff_a_date( integer $date1, integer $date2 )
Returns a slightly modified array of the difference between two dates |
public
string
|
|
public
string|array
|
#
seconds_to_human_time( integer $seconds, boolean $words = false, string $type = 'string' )
Converts seconds to a human readable string or an array |
public
string
|
|
public
string
|
Magic methods summary
Properties summary
private static
array
|
$legend_english
|
#
[
'millenium' => [ 'multiple' => 'millenia', 'value' => 31536000000 ],
'century' => [ 'multiple' => 'centuries', 'value' => 3153600000 ],
'decade' => [ 'multiple' => 'decades', 'value' => 315360000 ],
'year' => [ 'multiple' => 'years', 'value' => 31536000 ],
'month' => [ 'multiple' => 'months', 'value' => 2592000 ],
'week' => [ 'multiple' => 'weeks', 'value' => 604800 ],
'day' => [ 'multiple' => 'days', 'value' => 86400 ],
'hour' => [ 'multiple' => 'hours', 'value' => 3600 ],
'minute' => [ 'multiple' => 'minutes', 'value' => 60 ],
'second' => [ 'multiple' => 'seconds', 'value' => 1 ]
]
|