How to get the local date and time format of the client system

We need to get the date and time format of the client system. Currently, in our application, we have a requirement when a user enters the application that they must see the date and time format as their date and time format for the local PC.

For example, he refers to the form of the site, and then can see the exact format of his date and time in the local system instead of the server format. We tried this approach using date.toLocaleDateString() , but this returns the current local system date instead of the format. Even date.toLocalDateString() behaves differently in different browsers.

How to get the exact date and time format of the client system?

Example: like ( dd/MM/yyyy hh:mm , MM/dd/yyyy hh:mm , etc.).

What I expect:

+4
source share

All Articles