Jump to content

mktime help (negative value?)


mash

Recommended Posts

I'm working on editing a calendar program.  It is a simple equipment check out calendar; the user selects the item and check out/in date and time to add a reservation.  When I add a reservation on an item, I'm getting this error message:

 

Warning: mktime() [function.mktime]: Windows does not support negative values for this function in D:\aedecon\intranet\resources\resource_update.php on line 91

1198015200

1230760800

 

However, it does work and the reservation is added to the calendar.

 

Here is the code for the section where the problem is:

 

//*********************************************

// GET info from Form and URL

//********************************************

 

$check_out = $_GET[check_out];

$check_out_time= $_GET[time];

$max_out = $_GET[max_out];

$max_time = $_GET[max_time];

$name = $_GET[nid];

$check_in_month = $_POST[inmonth];

$check_in_day = $_POST[inday];

$check_in_year = $_POST[inyear];

$check_in_time = $_POST[intime];

$check_in_date = "$check_in_year-$check_in_month-$check_in_day";

$who = $_POST[who];

$why = $_POST[why];

 

$check_in_as_date = mktime($check_in_time,0,0,$check_in_month,$check_in_day,$check_in_year);

$max_out_as_date = mktime($max_time,0,0,substr($max_out,5,2),substr($max_out,8,2),substr($max_out,0,4));

$check_out_as_date = mktime(substr($check_out_time,0,2),0,0,substr($check_out,5,2),substr($check_out,8,2)

,substr($check_out,0,4));

 

The problem area, line 91, is this part:

$max_out_as_date = mktime($max_time,0,0,substr($max_out,5,2),substr($max_out,8,2),substr($max_out,0,4));

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.