maxudaskin Posted April 7, 2008 Share Posted April 7, 2008 I have this page: http://www.virtualzoom.net/admin/events.php Error: Warning: mktime() expects parameter 5 to be long, string given in /home/.grable/vzoom/virtualzoom.net/admin/events.php on line 267 Code: <?php /* Define Dates */ $today = gmdate("Y/m/d"); // Set today's date | 2008/05/13 $today_unix = gmdate("Ymd"); // Set today's date | 20080513 $today_day = gmdate("d"); // Set today's day | 13 $today_month = gmdate("m"); // Set today's month | 05 $today_year = gmdate("Y"); // Set today's year | 2008 function dayofWeek($day,$month,$year){ global $day; $utime = mktime (1,1,1,$month,$day,$year); // Line 267 $day = date('w',$utime); if($day == 0){ $day = "Sunday"; }elseif($day == 1){ $day = "Monday"; }elseif($day == 2){ $day = "Tuesday"; }elseif($day == 3){ $day = "Wednesday"; }elseif($day == 4){ $day = "Thursday"; }elseif($day == 5){ $day = "Friday"; }elseif($day == 6){ $day = "Saturday"; } } if(empty($_GET['month'])){ $month = $today_month; }else{ $month = $_GET['month']; } if(empty($_GET['year'])){ $year = $today_year; }else{ $year = $_GET['year']; } $days = cal_days_in_month(CAL_GREGORIAN, $month, $year); echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; echo "<tr>"; echo "<td width=\"3%\" style=\"border-top:solid #FFFFFF 1px;\" height=\"20\" align=\"center\" valign=\"middle\" bgcolor=\"#333355\"> </td>"; echo "<td width=\"32%\" style=\"border-top:solid #FFFFFF 1px;\" align=\"center\" valign=\"middle\" bgcolor=\"#333355\"><span class=\"white_text\">Date</span></td>"; echo "<td width=\"65%\" style=\"border-top:solid #FFFFFF 1px;\" align=\"center\" valign=\"middle\" bgcolor=\"#333355\"><span class=\"white_text\">Event(s)</span></td>"; echo "</tr>"; $i = 1; while($i < $days + 1){ dayofWeek($i,$today_month,$today_year); echo "<tr>"; echo "<td height=\"20\"> </td>"; echo "<td>" . $i . $day . "</td>"; echo "<td>No Event</td>"; echo "</tr>"; $i++; } echo "</table>"; ?> Any Ideas? Link to comment https://forums.phpfreaks.com/topic/100013-solved-mktime-error/ Share on other sites More sharing options...
craygo Posted April 7, 2008 Share Posted April 7, 2008 Not to go crazy but why not just use the date function $dayofweek = date("l", strtotime($today)); Ray Link to comment https://forums.phpfreaks.com/topic/100013-solved-mktime-error/#findComment-511454 Share on other sites More sharing options...
cooldude832 Posted April 7, 2008 Share Posted April 7, 2008 mktime likes integers so if anything you throw at it resembles a string i.e March or 07 it dies usually Link to comment https://forums.phpfreaks.com/topic/100013-solved-mktime-error/#findComment-511462 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.