Jump to content

Date format


piyush23424

Recommended Posts

Thanks for replying.

I am getting this error with your code:

$date = date('Y-m-d',strtotime($datefor[0]));

 

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for '5.5/no DST' instead in C:\xampp\htdocs\vikramtestingarea\guri\explode\explode1.php  on line 21

 

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for '5.5/no DST' instead in C:\xampp\htdocs\vikramtestingarea\guri\explode\explode1.php on line 21

1970-01-01

Link to comment
https://forums.phpfreaks.com/topic/195702-date-format/#findComment-1028160
Share on other sites

I am getting this error with your code:

That's not my code. As soon as you altered it or even just copied it into your file and ran it on your server, it became your responsibility for what it does.

 

A) Did you read the error message and set a default time zone like it states.

B) The value in $datefor[0] is not what you think because that code gave a default date of 1970-01-01 that corresponds to a zero value from the strtotime() function, meaning that strtotime() could not operate on what you supplied it.

Link to comment
https://forums.phpfreaks.com/topic/195702-date-format/#findComment-1028164
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.