This topic is locked
[SOLVED]

 Date format issue

10/11/2013 12:35:09 PM
PHPRunner General questions
T
Tayyab Ilyas author

I have column "File Date"

In regional settings i have US (English)

In Date Field Edit as page i have Date format MM/DD/YYYY English (United States)

In View as is "Short Date"

Database date format is default.
Now in events after record add it sends an email with date i want data format as US format MM/DD/YYYY but it shows me as YYYY-MM-DD HH:MM:SS (

C
cgphp 10/11/2013

You can format a date as you like. Check the DateTime

$date = new DateTime($your_date_from_database);

$new_date_format = $date->format('m/d/Y');


Replace $your_date_from_database with the real name of the variable that contains the date from database.

Then, the $new_date_format variable will contain the new date set as US format.

T
Tayyab Ilyas author 10/12/2013

Cristian, Thanks alot - it worked.