openlss / func-time
Time helper functions
Installs: 1 885
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.2
This package is not auto-updated.
Last update: 2024-10-26 15:04:58 UTC
README
Date and Time functions
Usage
$timestamp = time()-3600; $ago = age($timestamp); //returns 1 hour $timestamp = time()+3600 $in = future_age($timestamp); //returns 1 hour $time = timestamp()-7200; $hours = hours($time); //returns 2
Reference
age($tm,$end=false)
- $tm Timestamp to use
- $end Timestamp to use as NOW otherwise defaults to time()
future_age($tm,$end=false)
Same prototype as age() but works on a future time
hours($tm,$inc=1)
- $tm The range in seconds
- $inc Increment eg: 2 = every half hour Returns the number of hours to the inc power