Hi, I am fairly new to PHP and am currently working on my resume page of my personal website. For each skill that I have listed I have also listed the number of years its been since I started using that particular software or language. So i found this script to calculate the time its been from a specific date. It looks like this
// <?php
// function dateDiff($dformat, $endDate, $beginDate) {
// $date_parts1 = explode($dformat, $beginDate);
// $date_parts2 = explode($dformat, $endDate);
// $start_date = gregoriantojd($date_parts1[0], $date_parts1[1], $date_parts1[2]);
// $end_date = gregoriantojd($date_parts2[0], $date_parts2[1], $date_parts2[2]);
// return $end_date - $start_date;
// }
Then next to the listing of each software i have this:
// <?php
// $dob="02/01/2005";
// $aot = round(dateDiff("/", date("m/d/Y", time()), $dob)/365, 0);
// if($aot < 1) {
// echo "< 1 year";
// }
// else {
// echo $aot . " years";
// }
This script runs fine on my local host (windows XP) But when I upload it to my shared server at A small orange it throws me an error:
Fatal error: Call to undefined function gregoriantojd()
I have searched all over forums and keep coming back to one thing. I have to Compile php with --enable--calender. Unfortunately i have no clue of how to do this. i have searched long and hard for the answer and have found nothing. can someone please help.
Compiling PHP extensions.
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Your shared host will, most likely, not allow you to recompile their PHP. Either get them to do so, or find another snippet that doesn't need the Calendar extension.
If you look in Code Snippets there is a thread by printf (that's the username, not the function) which does date differentials without Calendar using simple timestamps.
If you look in Code Snippets there is a thread by printf (that's the username, not the function) which does date differentials without Calendar using simple timestamps.