SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict user_A's Avatar
    Join Date
    Mar 2004
    Location
    Vancouver, BC
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP 5: Date & Time Function

    Does anyone know if the date and time functions changed somehow in PHP 5, cause we recently updated to version 5 and i'm having trubles with my dates.

    I am able to insert into a database table, echoing the date is fine aswell, and inserting a (event in this case) into my database works fine, it's just that the date on the event is incorrect by a month)

    here's my code:

    PHP Code:
    $date date (" l dS of F Y"mktime(0,0,0,$info['event_month'], $info['event_day'], $info['event_year']));
    $to_date date (" l dS of F Y"mktime(0,0,0,$info['to_month'], $info['to_day'], $info['to_year']));
        
    $time_array split(":"$info['event_time']);
        
    $time date (" g:ia"mktime($time_array['0'],$time_array['1'],0,$info['event_month'],$info['event_day'],$info['event_year']));
        
    $to_time date (" g:ia"mktime($time_array['0'],$time_array['1'],0,$info['to_month'],$info['to_day'],$info['to_year'])); 
    Thanks

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    The date functions work exactly as in PHP4. Are you sure that the data stored in $info is correct?
    ERIK RIKLUND :: Yes, I've been gone quite a while.

  3. #3
    SitePoint Addict user_A's Avatar
    Join Date
    Mar 2004
    Location
    Vancouver, BC
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it was working up untill a day ago, i don't know what i did to screw it up...

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could it be something wrong with the server?
    I will not flame the newbies,
    I will not flame the newbies,
    I will flame the newbies...
    Table free is the way to be!


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
  •