www.webdeveloper.com
Results 1 to 3 of 3

Thread: Query and date as number

  1. #1
    Join Date
    Sep 2005
    Posts
    1,630

    Query and date as number

    I have set query like:
    [SQL] SELECT userid, usernamejoindate, lastactivity
    FROM user
    AND joindate <1298937600
    AND lastactivity - joindate < 1814400

    How to set JOINDATE to my date as it is number?
    1298937600

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,266
    See mktime() witch get Unix timestamp for a date. This timestamp is a long integer containing the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified.

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,322
    Not exactly sure what you want to convert to what, but MySQL has the FROM_UNIXTIME() and TO_UNIXTIME() functions for doing UNIX timestamp conversions in the SQL itself.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles