SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict greg76's Avatar
    Join Date
    Aug 2004
    Location
    Poland
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up mktime() expects parameter 1 to be long

    Hi ya'll

    I came to work this fine, rainy and cloudy day , started the job system I had written in PHP and...

    saw this nasty error on every page where time calculation using mktime() function took place.

    My syntax looked like this:
    PHP Code:
    mktime (''''''$var$var$var
    Seems, that new version of PHP does not take '' as a value, hence creating a syntax error.

    When I added a value to first three fields, error disapeared and my job system looks as it did yesterday.

    PHP Code:
    mktime ('0''0''0'$var$var$var
    Just to let you know, if you are struggling with same error.

    Regards,
    Gee

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    All the parameters to mktime() are numeric.. you shouldn't be giving it strings of any type.

    mktime(0, 0, 0, etc...)


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
  •