SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru godsfshrmn's Avatar
    Join Date
    Mar 2001
    Posts
    671
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    # days between dates

    Is it possible to get the number of days between two dates formatted in this way: June 19, 2004 9:06 PM? Thanks in advance
    s c r i p t s f o r y o u . n e t
    ScriptsForYou

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    Ohio
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look into converting the date to a Unix friendly date with strtotime() then dividing the difference by the number of seconds in a day.

  3. #3
    SitePoint Enthusiast T300's Avatar
    Join Date
    Jul 2004
    Location
    London - UK
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kusuri
    Look into converting the date to a Unix friendly date with strtotime() then dividing the difference by the number of seconds in a day.
    And then you may want to format/round the number to 0, 1 or 2 decimal points using sprintf() or round()

    T.

  4. #4
    SitePoint Guru godsfshrmn's Avatar
    Join Date
    Mar 2001
    Posts
    671
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by T300
    And then you may want to format/round the number to 0, 1 or 2 decimal points using sprintf() or round()

    T.
    Yeah thats what I eneded up having to do.
    s c r i p t s f o r y o u . n e t
    ScriptsForYou


Bookmarks

Posting Permissions

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