Webix Spreadsheet User Guide
  • Introduction
  • SpreadSheet Basics
  • Working with Cells
  • Using Formulas for Math Calculations
  • Formatting Text and Cells
  • Formatting Text
  • Formatting Numbers
  • Formatting Dates
  • Working with Rows and Columns
  • Working with Sheets
  • Excel Import/Export
  • Printing Interface
  • Working with embedded Charts and Images
Powered by GitBook
On this page
  • Customizing the Default Date Format
  • Custom Date Format

Formatting Dates

PreviousFormatting NumbersNextWorking with Rows and Columns

Last updated 5 years ago

For dates, there is the Date format.

To apply the date format to a cell value:

1) Select a cell or a range of cells to format. 2) Click the Date format button in the Number section to open a drop-down list with number formats. 3) Choose the necessary format that will be applied to the selected cells.

Customizing the Default Date Format

You can choose one of the predefined date and time formats:

1) Select a cell or a range of cells to format. 2) Click the Date format button in the Number section to open a drop-down list with number formats and select the Date option. 3) Select Date. 4) Select the format:

Custom Date Format

You can customize the predefined Date formats.

To customize a predefined date format:

1) Select a cell or a range of cells to apply custom format to. 2) Click the format button in the Number section and select the Custom option. 3) Select Custom. 4) Edit the date format line:

An example of a format line:

mm/dd/yyyy hh:mm

These are the allowed characters for a date format string:

  • the date part:

    • "yy" - the year as a two-digit number (00 to 99);

    • "yyyy" - the year as a four-digit number (1900–9999);

    • "m" - the month as a number without a leading zero (1 to 12);

    • "mm" - the month as a number with a leading zero (01 to 12);

    • "mmm" - the month as an abbreviation (Jan to Dec);

    • "mmmm" - the month as a full name (January to December);

    • "mmmmm" - not supported by Webix, but interpreted as "mmmm"

    • "d" - the day as a number without a leading zero (1 to 31);

    • "dd" - the day as a number with a leading zero (01 to 31);

    • "ddd" - the day as an abbreviation (Sun to Sat);

    • "dddd" - the day as a full name (Sunday to Saturday);

  • the time part:

    • "h" - the hour based on the 24-hour clock (0 to 23);

    • "hh" - the hour based on the 24-hour clock with a leading zero (00 to 23);

    • "m"- not supported by Webix, but interpreted as "mm"

    • "mm" - the minute as a number with a leading zero (00 to 59);

    • "s" - not supported by Webix, but interpreted as "ss"

    • "ss" - the second as a number with a leading zero (00 to 59);

    • "AM/PM" - displays AM (for times from midnight until noon) and PM (for times from noon until midnight).

5) To apply the new format, click Save.

Date Format Settings
Custom Date Format