SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    US
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Convert time string

    Here's my sample code:

    PHP Code:
    $time time();
    echo 
    $time

    and so, i want when insert a date / month / year number.
    it'll be converted to $str_date to time() shape...

    PHP Code:
    $date $_POST["day"];
    $month $_POST["month"];
    $year $_POST["year"];
    $str_date $date.$month.$year
    Last edited by rassenvn; Apr 19, 2005 at 05:05.

  2. #2
    Chessplayer kleineme's Avatar
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    take a look at mktime

    Code:
    $date = mktime(0, 0, 0, $_POST['month'], $_POST['date'], $_POST['year']);
    if it is "day" what you mean by $_POST["date"]
    Never ascribe to malice,
    that which can be explained by incompetence.
    Your code should not look unmaintainable, just be that way.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    US
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just thank, and 0,0,0 is a h-i-s ?
    thank's lot


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
  •