Results 1 to 2 of 2

Thread: UNIX time to string

  1. #1
    Member silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    189

    Question UNIX time to string 11 Jul 2011 @ 22.06

    HI guys,

    I have a unix timestamp: 7138 - the result of subtracting two timestamps and now I need to put it back to a string and pad it out with zeros so that I get: hh/mm/ss

    if $resut is my timestamp (7138)

    why can't I do:

    $readable = date('H:i:s', $result);

    when I echo this it comes out as:

    20:58:58 but I know from using an online UNIX calculator that this should be:

    01:58:58 What am I doing wrong???
      Reply With Quote

  2. #2
    Member silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    189

    Default 11 Jul 2011 @ 23.02

    [SOLVED]

    $result = gmstrftime ('%H:%M:%S', $result);

    This overrides the timezones/offsets which were giving me the silly answers
      Reply With Quote

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •