00:00:00
Sponsor
Date/Time

Time

Simple Time Display: Minute, Hour, and Seconds

Instructions

Make sure you have the VisualDX script in your <head>. Checkout the Quick Start for how to do this.

Displaying the Current Time:

  1. Add the attribute vdx-time-currenttime to any element to display the current time.
  2. Use vdx-time-clock="12-hour" for 12-hour format or vdx-time-clock="24-hour" for 24-hour format.
  3. Optionally, specify the timezone with vdx-time-timezone.

Example: <div vdx-time-currenttime vdx-time-clock="12-hour" vdx-time-timezone="America/New_York"></div>

Displaying the Current Minute:

  1. Use vdx-time-min in an element to display the current minute.
  2. Customize the display with vdx-time-display="1-digit" or vdx-time-display="2-digit".

Example: <div vdx-time-min vdx-time-display="2-digit"></div>

Displaying the Current Hour:

  1. Use vdx-time-hour in an element to display the current hour.
  2. Select between 12-hour and 24-hour format using vdx-time-clock, and set the digit format using vdx-time-display.

Example: <div vdx-time-hour vdx-time-clock="24-hour" vdx-time-display="2-digit"></div>

Displaying the Current Second:

  1. Use vdx-time-seconds in an element to display the current second.
  2. Choose between single-digit and double-digit formatting using vdx-time-display.

Example: <div vdx-time-seconds vdx-time-display="2-digit"></div>

Examples of the Time flying by

Current time NCY
Current min Dublin
Current hour UTC 24 hour
Current sec NCY
Current hour JST 12 hour 1 digit