0

I have got an input type='datetime-local' control on my angular form. By default the display format is: dd/mm/yyyy with the hour and minute.

Is it possible to set the input date display on the control to be in a specific format eg. DD MMM YYYY with the hour and minute?

Thanks!

xeshu
  • 788
  • 2
  • 11
  • 24
  • I don't believe the native browser date/datetime-local inputs support custom formatting and use the format as provided by the host operating system so that users in different cultures see an appropriate format. – phuzi May 04 '23 at 15:03
  • Thanks, yes that is what I was afraid of..it may be that I might need to change the type then. I understand the whole point of datetime-local is to use the different client culture and display it accordingly, but what if we just want it displayed in a specific format regardless of culture / time zone? – xeshu May 04 '23 at 15:09
  • Does this answer your question? [How do I format a date in JavaScript?](https://stackoverflow.com/questions/3552461/how-do-i-format-a-date-in-javascript) – l -_- l May 04 '23 at 18:18
  • No, I need to format that date that gets displayed on the datetime-local control's input box. It seems there is no way to do it. – xeshu May 05 '23 at 07:53

0 Answers0