Data Format

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
danoshea
Posts: 9
Joined: 2015-02-25 21:48

Data Format

Post by danoshea » 2015-03-07 12:41

With the data format, I uploaded a large CSV file that has in a cell the date 12/31/2014. So of course in MySQL, it displays as 2014/12/31.

I want the date to display 12/31/14.

So in the dataFormats file, I added:

Code: Select all

US Short Date (example: 03/28/08); DATE_FORMAT(%%FIELD%%, '%m/%d/%y')
But I still get a display of 03/28/2008.

I did a quick change to test in the main section (when I highlight the database number in upper left) under "Localization Settings" and changed it to "Day, month, year" (instead of "Month, day, year) in the dropdown and saw the dates now displayed as 31/12/2014 once I generated the PHP pages.

So it seems that the "Localization Settings" overrides the dataFormats file so I can't display the date as 12/31/14?

Thanks

Satya Kavala
Veteran Member
Posts: 45
Joined: 2015-04-15 06:33
Location: Hyderabad
Contact:

Re: Data Format

Post by Satya Kavala » 2015-04-21 05:38

Hi danoshea,
try this below line of code in your php file in hooks folder before/after insert and before/after update functions.
$data['date'] = date('d-m-Y', strtotime($data['date']);

it may helps you
Thanks&Regards
Satya Kavala
[email protected]

Post Reply