time converstion

Discussion in 'PHP' started by dizyn, Nov 21, 2007.

  1. #1
    Hi

    I am having problem in converting time:

    I have "1196242839" and I want to convert it to find exact time.

    I tired "strptime()" but get error.

    any help
     
    dizyn, Nov 21, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    What is "exact time"?

    You can use date:
    
    echo date('dS M Y, H:i:s', 1196242839);
    
    PHP:
     
    nico_swd, Nov 21, 2007 IP
  3. dizyn

    dizyn Active Member

    Messages:
    251
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    thank you
    One more thing:

    Can I find the difference between 1196242839 and 1196240839

    I mean how much time difference is between both? like how many hours, minutes and days etc
     
    dizyn, Nov 21, 2007 IP
  4. salmanshafiq

    salmanshafiq Well-Known Member

    Messages:
    260
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    128
    #4
    salmanshafiq, Nov 21, 2007 IP
  5. tamen

    tamen Peon

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    There is (1196242839 - 1196240839) seconds between the two timecodes. From there you can divide by 60 to get minutes. Divide that by 60 again to get hours. Divide by 24 to get days.
     
    tamen, Nov 21, 2007 IP