Samsung Electronics logo

Retrieving the Local Date and Time Format



Learning how to handle date and time formats in your application is a basic locale management skill:

  1. To check the date format, use the getDateFormat() method:

    var dateFormat = webapis.time.getDateFormat();
    console.log("Date format is " + dateFormat);
    
  2. To check the time format, use the getTimeFormat() method:

    var timeFormat = webapis.time.getTimeFormat();
    console.log("Time format is " + timeFormat);