PDA

View Full Version : [DHTML] jsPHPDate



Chocolate
06-20-2007, 04:14 PM
1) CODE TITLE: jsPHPDate

2) AUTHOR NAME/NOTES: Choco (me)

3) DESCRIPTION: This code ports most of the PHP date() function to javascript, allowing you to easily fetch different portions of the current time/date. For example:
date("h:i:s");
Would return something like:
12:30:15
If it were 12:30 and 15 seconds in the afternoon. =)
You can find the available flags here:
http://us2.php.net/date
The only ones unavailable are the following:
o, B, e, T, c, I, r, U
Most of those are timezone-related flags, which I skipped due to the difficulties of calculating various aspects of timezones with javascript.
4) URL TO CODE:
http://h1.ripway.com/chocolate570/jsphpdate.js
or, ATTACHED BELOW (see #3 in guidelines below):