Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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

50%
+1 −1
Q&A yyyy/mm/dd instead expected dd/mm/yyyy format in 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 default: dd/m...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by Peter Taylor‭

Question php html css
#2: Post edited by (deleted user) · 2021-04-03T14:41:26Z (over 3 years ago)
  • 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 by (deleted user) · 2021-04-03T13:58:38Z (over 3 years ago)
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`?