mktime - non-well formatted numeric value error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pedalpete
    New Member
    • Oct 2007
    • 109

    mktime - non-well formatted numeric value error

    I've got this error which keeps popping up, but I can't seem to figure out why.

    The error reads

    ' A non well formed numeric value encountered in filename on line <b>198</b>'.

    the lines which contain the error are all the same.

    Code:
    list($sHour, $sMin, $sSec)=split(':', $startTime2);
    	$startTime2 = date('H:i:s', mktime($sHour, $sMin, 0, 0,0,0));
    	list($eHour, $eMin, $eSec)=split(':', $endTime2);
    	$endTime2 = date('H:i:s', mktime($eHour, $eMin, 0, 0,0,0));
    $startTime2 = date('Y-m-d,H:i:s', mktime($sHour,$sMin,0, $month, $day, $year));
    $endTime2 = date('Y-m-d,H:i:s', mktime($eHour,$eMin,0, $month, $day, $year));
    I have output the sql statement which inputs these values, so the output of these lines is
    "VALUES ('40', '128', '09:00:00', '16:00:00', '2008-03-11', '2008-03-11')".

    So from the output, I can see that the values are fine, so I don't know why I am getting these errors.
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Why are you being so evasive with the detail you are providing?
    It is very difficult to see what is happening but I am guessing
    you are passing the wrong argument types to mktime.
    Each argument should be an integer
    Code:
    int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] )

    Comment

    • pedalpete
      New Member
      • Oct 2007
      • 109

      #3
      Hey code green,
      I am not trying to be 'evasive' at all, and didn't realize I was.

      My apologies.

      You were correct however. I was using the wrong variable which was not completely an integer.


      Thanks,

      Pete

      Comment

      Working...