Sorry to disturb you guys...
I need a tiny and easy php snippet (one or two lines), because my bad php skills already come to an end here. 😶
Situation:
1. I have a database entry called "cb_birthday". Data is abvously saved in the format YYYY-MM-DD.
2. I can sucessfully display this birthday in a field of my ChronoForms from.
Unfortunately the displayed information looks like YYYY-MM-DD, but I need the date format DD.MM.YYYY ...
My idea:
Echo variable $birthday2 (like above) and previously define something like:
Now what's the correct php syntax for that line?
Thanks in advance and best regards,
Kepp
I need a tiny and easy php snippet (one or two lines), because my bad php skills already come to an end here. 😶
Situation:
1. I have a database entry called "cb_birthday". Data is abvously saved in the format YYYY-MM-DD.
2. I can sucessfully display this birthday in a field of my ChronoForms from.
<?php echo $user_info->cb_birthday; ?>" />
Unfortunately the displayed information looks like YYYY-MM-DD, but I need the date format DD.MM.YYYY ...
My idea:
Echo variable $birthday2 (like above) and previously define something like:
$birthday2 = $user_info->cb_birthday formatted to DD.MM.YYYY
Now what's the correct php syntax for that line?
Thanks in advance and best regards,
Kepp
Hi kepp,
Use the PHP strtotime function to create a timestamp; then date() to format it.
Something like
Not tested and may need debugging.
Bob
Use the PHP strtotime function to create a timestamp; then date() to format it.
Something like
<?php echo date('m-d-Y', strtotime($user_info->cb_birthday)); ?>" />
Not tested and may need debugging.
Bob
Something like
<?php echo date('m-d-Y', strtotime($user_info->cb_birthday)); ?>" />
That's it, thanks a lot!
Those $25 were worth every cent of it! 😀
This topic is locked and no more replies can be posted.