Jump to content

lanu777

New Members
  • Posts

    4
  • Joined

  • Last visited

lanu777's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. nice thats working, i used it like so: $adate = strtotime('2013-10-30'); $bdate = strtotime('2013-10-31'); $now = mktime(0,0,0); echo '<pre>'; printf("%-15s\t%s\n", ' ', ' '); while ($adate < $bdate) { printf("%-15s\t%6d\n", 'this be how many days passed:<span>', floor(($now-$adate)/86400), '<span>' ); $adate = strtotime('+1 days', $adate); } echo '</pre>'; now not exactly sure how to get this number to print to a variable - i tried this and didnot succeed: $howmanydayspassed = printf("%-15s\t%6d\n", floor(($now-$adate)/86400) ); Really appreciate your help there you are awesome!
  2. hmm my php info says im runnning Version 5.2.17, yet Im getting this error: Fatal error: Call to undefined method DateTime::getTimestamp()
  3. I tried this and got the following error: Fatal error: Class 'DatePeriod' not found I guess maybe this is from a newer version of php i'm working with? What is the purpose of $bdate? I'm unclear on that. Thanks so much for your help its much appreciated!
  4. hi there trying to create a very simple date counter script here. I just cant recall how to do all this. There is a span of days starting at oct 30th, 2013 and I want to get todays date and then determine how many days have passed. Am I even on the right track here? Any help would be mmuch appreciated! my feeble attempt is below: <?php $elvenportal = mktime(0,0,0,10,30,2011); $now = mktime(date("H"),date("i"),date("s"),date("n"),date("j"),date("Y")); $theeday = date("d")-1; $late = date("H"); if ($late < 7) {$now = mktime(0,0,0,date("n"),$theeday,date("Y"));}; if ($_POST["dayz"] != "" ){ if ($_POST["month"] != "" ){ if ($_POST["year"] != "" ){ $now = mktime(0,0,0,$_POST["month"],$_POST["dayz"],$_POST["year"]); };};}; $offset = $now - $elvenportal; print $offset; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.