3
I took a system for maintenance, and when migrating to another server, started to give error in an input with the current date, ex:.
<input type='text' value='<?php echo date("d/m/Y"); ?>'>
But the following mistake is making:
WARNING: 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 THE TIMEZONE 'UTC' FOR NOW, BUT PLEASE SET DATE.TIMEZONE TO SELECT YOUR TIMEZONE. IN /XXX/XXXXXX/XXXXXXXX/PAINEL-MASTER.PHP ON LINE 458
WARNING: 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 THE TIMEZONE 'UTC' FOR NOW, BUT PLEASE SET DATE.TIMEZONE TO SELECT YOUR TIMEZONE. IN /XXX/XXXXXX/XXXXXXXX/PAINEL-MASTER.PHP ON LINE 458
11/01/2018
Set at the beginning of PHP:
date_default_timezone_set('America/America/Sao_Paulo');
But from there I do not know how to set the date (Day/Month/Year) within the input, I read about what is suggested in WARNING but did not solve.
But and setting this, as I display in the input the date ?
– ElvisP
solved, okay, thanks...
– ElvisP
I believe it is a good solution at the global level of the server. If you have programs that need to change the spindle to run in a specific region, you can set it in PHP via
date_default_timezone_set()
– Dagobe