148
Views
4
Comments
Change the datetime format of input box of type  "datetime"
Question
Application Type
Mobile

Working on a mobile app where using this input box. It show different format over devices.
When opened in browser it show datetime in dd-MMM-yyyy hh:mm tt  format.
Similarly on android device format is dd/mm/yyyy, hh:mm tt.

Can we change its format and keep it similar over all devices?


Screenshot20210728163009.png
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I think it takes whatever is the default for the system.

UserImage.jpg
Mannu Kumar

Thanks Kilian!
Actually, My findings was also very similar to what you have said.
Moreover, can/how we change the default format of the client system/device?
Because I was unable to find it in settings of devices having recent android versions.

2023-09-05 06-31-18
Pavan Rajapurkar

Hello Mannu,

1) If you want to change the date format in the mobile  you can use the FormatDateTime() check this URL.

2) Check out this post  (Mobile apps follow the device settings for date and number format). 

3) You can also change the Date format from the service center->Administration->Environment Configuration  if you want it to be changed in the overall Environment.

Regards,

Pavan R

UserImage.jpg
Mannu Kumar

Thanks Pavan ,
Adding my comment to your suggestions, please check these.

1) If you want to change the date format in the mobile  you can use the FormatDateTime() check this URL.
COMMENT: Tried with this, using this function to format datetime before rendering it in the widget didn't worked and widget did not shown any value at all.

 

2) Check out this post (Mobile apps follow the device settings for date and number format).
COMMENT: Agree, but can/how we change device settings in recent android versions?

3) You can also change the Date format from the service center->Administration->Environment Configuration  if you want it to be changed in the overall Environment.
COMMENT: Changing this will change the format of whole environment, as per the requirement just need to change date time format on  a specific input box of datetime type (HTML 5 input type = "datetime-local")

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.