Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I have an HTML-PHP-CSS contact form with a date field: <input type="date" name="date" id="cf_input_date"></input> The default value in this field is the W3C built-in default: dd/m...
#2: Post edited
yyyy/mm/dd instead expected dd/mm/yyyy format in an HTML form PHP-created-HTML output
- yyyy/mm/dd instead expected dd/mm/yyyy format in PHP-created-HTML output
#1: Initial revision
yyyy/mm/dd instead expected dd/mm/yyyy format in an HTML form PHP-created-HTML output
I have an HTML-PHP-CSS contact form with a date field: <input type="date" name="date" id="cf_input_date"></input> * The **default value** in this field is the [W3C built-in](https://w3c.org) default: `dd/mm/yyyy` * The **date-picking pattern** in this field is the W3C built-in default `dd/mm/yyyy` ## My problem Everything was allegedly fine until I printed this HTML as output to my email box (via PHP).<br> In my email box, the output pattern for picked dates is the exact opposite of the pattern I already use in the form: yyyy/mm/dd ## Things I have tried to solve it * `dir="ltr"` or `dir="rtl"` attributes-values and `direction: ltr` or `direction: rtl` properties-values don't help in flipping the output * Various CSS tricks all ended in failure * Sadly I can't use JavaScript comfortably in this case because the email output appears in a third party email client which doesn't easily allow JavaScript manipulation of the DOM ## My question How to ensure that my HTML-PHP output is in `dd/mm/yyyy` pattern (as default for the input field itself) instead the "flipped" `yyyy/mm/dd`?