Int to date

Discussion in 'Databases' started by maxell6230, Feb 20, 2010.

  1. #1
    Hi Does anyone know how to convert an integer (currently in an sqlite DB) into a meaningful date using PHP. An example of the date is '2455217' or '2455231', I have spent three days tring to find a solution but just cannot figure it out and nothing in the forums. Any help would be appreciated. Thanks in advance.
     
    maxell6230, Feb 20, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    echo date('Y-m-d',2455217)."\n";
    PHP:
     
    koko5, Feb 20, 2010 IP
  3. maxell6230

    maxell6230 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Trouble is the dates dont come out right, they all come out as 29-01-1970 when I know that 2455217=20 Jan 2010 and 2455241=13 Feb 2010. Is there some special formula you are meant to use.
     
    maxell6230, Feb 20, 2010 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    mwasif, Feb 21, 2010 IP