Weeeeeeelllllll, this just wasn't sufficient for my needs because I hate reading military time. I think its annoying and other things, but thats for another article. Anyway, I decided to go about writing a little script that converts the military time to standard am, pm stuff.
Being a beginner, or relative beginner, this task took me quite some time (about 45 minutes) and gave me a pretty decent headache. I ended up taking two ibuprofen and finishing a pretty awesome, useful (har har) script! You wanna see it?
Code: Select all
/* Copyright © 2003 Brandon Paredes. All rights reserved.
brandon@paredes.cc */
$hour_convert = date ("H", getlastmod());
$hour = 0;
if ($hour_convert > 12) {
$hour = $hour_convert - 12;
} else {
$hour = $hour_convert;
}
$am_pm = " ";
if ($hour_convert < 13) {
$am_pm .= "am";
} else {
$am_pm .= "pm";
}
echo "<b>Date Uploaded:</b> " . date ("F d Y $hour:i", getlastmod());
echo "$am_pm.";
echo "<br>";Yuk, Yuk,
Brandon