Adding Two times to change current date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sureshjack
    New Member
    • Dec 2012
    • 1

    Adding Two times to change current date

    Code:
    <?php
    $timezone = "Asia/Calcutta";
    if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
    echo date('d/m/Y H:i:s A');
     //echo $date = date("Y/m/d H:i:s");echo "\n";
    
    $original=time($timezone);
    if(isset($_POST['btn']))
    {
    $hr=$_POST['hour'];
    $min=$_POST['minute'];
    $sec=$_POST['second'];
    $modified = $original+($hr*60*60)+($min*60)+$sec;
    echo date("d/m/Y H:i:s A",$modified);echo "\n"; 
    ?>
    this is ma code i am trying to adding two time but the date will change only once . after that i tried but didnot change the date . please help me ... Thanks in advance.
    Last edited by Meetee; Dec 10 '12, 10:15 AM. Reason: Use code tags <code/> around your code
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I have no idea what your question is.

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      two things:
      - Parse Error: unexpected $end
      - time() does not accept parameters

      Comment

      Working...