SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: why?

  1. #1
    SitePoint Zealot cachobong's Avatar
    Join Date
    Jan 2005
    Location
    cebu
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    why?

    PHP Code:
    $xtimein $dd['timein'];
    echo 
    $xtimein;
    $xtimein strtotime('H:i',$xtimein); 
    at the first echo it echoes 08:00
    then when i convert it to time, it becomes -1
    when i use the date() some error comes out

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://ca.php.net/strtotime

    You should be calling it strtotime($xtimein). If I've understood your post correctly, $dd['timein'] is "08:00"? If so, then strtotime should convert that into seconds. Date() accepts the time format, then a time stamp, but strtotime is expecting the English date in the first parameter.

  3. #3
    SitePoint Zealot cachobong's Avatar
    Join Date
    Jan 2005
    Location
    cebu
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but when i use strtotime($xtimein) this error is show

    Warning: strtotime() [function.strtotime]: Called with an empty time parameter. in C:\Apache\xampp\htdocs\adtrs\date.php on line 112


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
  •