DaDaBiK YYYY-MM-DD format HOW-TO

Transistor

New member
For anyone who wants to use yyyy-mm-dd date formats you need the following:

In program_files/include/general_functions.php you need to add a couple of lines to both functions below:

In function format_date($date) add

[pre]
case "yyyy_mm_dd": // Modification!
$date = $temp_ar[0].$date_separator.$temp_ar[1].$date_separator.$temp_ar[2];
break;
[/pre]

and in function format_date_time($date_time) add

[pre]
case "yyyy_mm_dd": // Modification!
$date = $temp_2_ar[0].$date_separator.$temp_2_ar[1].$date_separator.$temp_2_ar[2].$time_part;
break;
[/pre]

Finally, you need to select this option in program_files/include/config.php

[pre]
$date_format = 'yyyy_mm_dd'; // added format to general_functions.php.
[/pre]

Tested on DaDaBIK is 9.4-Monterosso.
 

eugenio

Administrator
Staff member
Thanks! It sounds correct me, maybe you can just return $date or return $date_time (the default format is already the one you need so you don't need any calculation).

I will add this option.

Best,
 
Top