Jump to content

time question???


darkfreaks

Recommended Posts

Warning: mktime() expects parameter 1 to be long, string given

 

any help would be appreciated ???

 

Code:

 

<?php
function formatDate($val)
  {
      list($date, $time) = explode(" ", $val);
      list($year, $month, $day) = explode("-", $date);
      list($hour, $minute, $second) = explode (":", $time);
      return date("l, m.j.y @ H:ia", mktime($hour, $minute, $second, $month, $day, $year));//error line
  }

?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/141168-time-question/
Share on other sites

this is pushing a datatype related error, php handles datatype conversions as you attempt to convert them..

 

you could fix this by converting them into themselves but their numeric equivelent to the string versions

 

      return date("l, m.j.y @ H:ia", mktime(($hour * 1), ($minute * 1), ($second * 1), ($month * 1), ($day * 1), ($year * 1)));//error line

Link to comment
https://forums.phpfreaks.com/topic/141168-time-question/#findComment-738889
Share on other sites

Archived

This topic is now archived and is 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.