Hi, good morning,
I've a spreadsheet of information to import which includes date and time in the format of DD/MM/YYYY and I'd like to correct them after import to be YY-MM-DD. There are too many to manually have to 'clean' in the spreadsheet before import.
I thought I could do it through PHP within my app, using the imported date in field [820] where the date imports to. I set up a PHP field and added the following:
$orgDate = [820]; //get the imprted dated
$date = str_replace('/','-',$orgDate);//swap the slash for a dash
$newDate = date("yy-MM-dd",strtotime($date));//create new date
I've ticked to create it dynamically, but I don't get an entry in the field. I wonder if anyone can help?
Thanks in advance
Use PHP to convert a Time & date
-
- Posts: 227
- Joined: 24 Sep 2018, 23:22
- Name: Stuart B
- Location: Manchester UK
Re: Use PHP to convert a Time & date
Dates do not work like that, no strings, no slashes and dashes... just UNIX time (number of seconds since 1970).
So, to display dates in adequate format in application change date format of Rukovoditel application.
Configuration -> Application -> Date Format
To change date format in exact Date Field, change: Settings -> Date Format
Regards,
Filip
So, to display dates in adequate format in application change date format of Rukovoditel application.
Configuration -> Application -> Date Format
To change date format in exact Date Field, change: Settings -> Date Format
Regards,
Filip