SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    php date related question!

    hai folks,

    PHP Code:
    $userdt="4/20/2011"; (notice the date is in American format)
    $dt=strtotime($userdt); 
    is above code is perfect? or i better split the values and use mktime()?

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,069
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    As per PHP's date formats the American format is one of the accepted formats and since it can't be confused with any format (since it uses slashes instead of dashes) I'd say you're fine
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    As per PHP's date formats the American format is one of the accepted formats and since it can't be confused with any format (since it uses slashes instead of dashes) I'd say you're fine
    Thanks a lOt scallio for the note....


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
  •