Php > Date Time sample source codes
Creates three SELECT form fields Month Day and Year
Creates three SELECT form fields Month Day and Year "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); /* if date invalid or not supplied, use current time */ if($useDate == 0) { $useDate = Time(); } /* make month selector */ echo "
\n"; for($currentMonth = 1; $currentMonth <= 12; $currentMonth++) { echo "
" . $monthName[$currentMonth] . "\n"; } echo "
"; /* make day selector */ echo "
\n"; for($currentDay=1; $currentDay <= 31; $currentDay++) { echo "
$currentDay\n"; } echo "
"; /* make year selector */ echo "
\n"; $startYear = date( "Y", $useDate); for($currentYear = $startYear - 5; $currentYear <= $startYear+5;$currentYear++) { echo "
$currentYear\n"; } echo "
"; } ?>
Choose a Date:
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage