global date format |
[eluser]peter222[/eluser]
I there any way to set global date format (dd-mm-YYYY) that comes from MySQL database? It is not comfortable to use php date() function in all application places. I want to user can set it in preferences how data is displayed in all aplication. How to do it?
[eluser]pistolPete[/eluser]
If you want to use a user specific date format, store the format string in the session's userdata. Retrieve the string wherever you need to display a date and pass it to PHP's date() function or one of the Date Helper functions.
[eluser]peter222[/eluser]
Thank You for help. Finally I have done it this way: set constans: Code: define('DATEFORMAT','d-m-YYYY'); and wrote dth_helper: Code: if ( ! function_exists('dth')) |
Welcome Guest, Not a member yet? Register Sign In |