Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.