Always on the move

February 22, 2004

Adding to the Sidebar

As I haven’t had much time to update lately (sorry!) I have at least had a little time to add a couple of elements to my sidebar that I hope you enjoy. Remember, this is for entertainment purposes only!

A few days ago I woke up around three in the morning and couldn’t get back to sleep. So I turned on the ‘puter and figured out how to get PHP to give me today’s date on the Hebrew calendar. Check out this code!

$jd = UnixToJD ();
$gregorian = JDToGregorian ($jd);
$jewish = jdtojewish ($jd);
$jewmonth = jdmonthname($jd,4);
list ($month, $day, $year) = split (’[/]’, $jewish);
if ($day == “1″):
echo “$day”;
echo “st of $jewmonth in the year $year\n”;
elseif ($day == “2″):
echo “$day”;
echo “nd of $jewmonth in the year $year\n”;
elseif ($day == “3″):
echo “$day”;
echo “rd of $jewmonth in the year $year\n”;
else:
echo “$day”;
echo “th of $jewmonth in the year $year\n”;

endif;

I’m sure there’s a more efficient way to write that, but it’s what I could come up with at three in the morning.

I also added SimJoe, which shows a summary of my mood at a particular time when I feel like updating the module. It gives me an excuse to update my blog more often, if nothing else.

Enjoy!

Posted by Joe in Uncategorized at 7:33 pm |

No comments for Adding to the Sidebar »

No comments yet.

Leave a comment

(required)

(required but not published)

RSS feed for comments on this post.