2011-08-17, 07:10 PM
So I have a form field returning the following string
that is stored in $datetime local varaible
and I use PHP's strtotime() to try to get a Unix timestamp for that date
but $orig_dateline is always empty. It does not return FALSE (PHP >= 5.1.0) or -1 (PHP < 5.1.0) so its not failing.
This is in a MyBB Plugin I am working on, and the time functions in MyBB appear to be working fine, so its not a server issue.
I can parse the $datetime variable just fine via
and if I print_r() these two arrays, they contain the proper values. I have even taken those arrays and pushed them into mktime() and even cast to (INT) each variable in the mktime() function and still no result.
Any thoughts?
n/m
its working now, for some reason die($orig_dateline); is not outputting anything,but if I echo it first, then push an empty die(); the resultant is valid.
strange.....
2011-09-28 16:45
that is stored in $datetime local varaible
and I use PHP's strtotime() to try to get a Unix timestamp for that date
$orig_dateline = strtotime($datetime);
but $orig_dateline is always empty. It does not return FALSE (PHP >= 5.1.0) or -1 (PHP < 5.1.0) so its not failing.
This is in a MyBB Plugin I am working on, and the time functions in MyBB appear to be working fine, so its not a server issue.
I can parse the $datetime variable just fine via
$datetime_parts = explode(" ",$datetime);
$date_parts = explode("-", $datetime_parts[0]);
$time_parts = explode(":", $datetime_parts[1]);
and if I print_r() these two arrays, they contain the proper values. I have even taken those arrays and pushed them into mktime() and even cast to (INT) each variable in the mktime() function and still no result.
Any thoughts?
n/m
its working now, for some reason die($orig_dateline); is not outputting anything,but if I echo it first, then push an empty die(); the resultant is valid.
strange.....