Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Unanswered: int(11) is outputted as a date

    Hey guys,

    I'm new to this forum and it has been some time since I was working with DB's.

    Here is my problem. I have a table with a column called "inside_date". This column is of type "int(11)". In it I have a number, e.g. 1327939700. The output on the website is then "Monday, 30.01.2012".

    I do not have a clue on how this number is transfered into this date. Can some one please give me an explanation?!?

    What would be the number for "Wednesday, 08.08.2012"?

    THANKS for your help.

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    The number might be seconds since 1970-01-01.(unix time?)

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by nordisch View Post
    1327939700. The output on the website is then "Monday, 30.01.2012".
    at 11:08:20 a.m.


    Quote Originally Posted by tonkuma View Post
    The number might be seconds since 1970-01-01.(unix time?)
    not "might be" -- "is"


    Quote Originally Posted by nordisch View Post
    I do not have a clue on how this number is transfered into this date. Can some one please give me an explanation?!?
    look up the FROM_UNIXTIME() function in da mysql manual


    Quote Originally Posted by nordisch View Post
    What would be the number for "Wednesday, 08.08.2012"?
    run this query in mysql --
    Code:
    SELECT UNIX_TIMESTAMP('2012-08-08')
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Aug 2012
    Posts
    2
    thanks! this looks like it is correct.

Posting Permissions

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