Blog · Gutenberg

Dynamic Date block for WordPress

Outputs the current date, time or copyright year automatically, with live clock option.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Outputs the current date, time or copyright year automatically, with live clock option.

Inspector panels on this block: Date Settings, Text & Style, Color. Those titles come from index.js, not from a shared template.

Behavior controls: “Format” options: Long Date (Monday, Jan 1, 2024), Short Date (Jan 1, 2024), Numeric Date (01/01/2024), Year Only (2024), Time 12h (1:30 PM); “Timezone” options: Site Timezone, UTC, Custom; “HTML Tag” options: span, p, div; “Text & Style — Alignment” options: Left, Center, Right.

Where to find it

Gutenberg inserter → Blog → search “Dynamic Date” (block name `blockenberg/dynamic-date` in block.json). Style it in the sidebar after insert.

How to use Dynamic Date block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Dynamic Date”, insert it. Category: Blog.
  3. Configure inspector controls that exist on this block. Open Date Settings. Set “Format”, “Timezone”, “Custom Timezone”, “Live Clock (auto-update)”.
  4. Check the published page. The view script reads HTML data attributes: data-format, data-live, data-tz. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
FormatSelect control; the chosen value is saved on the block. Options: Long Date (Monday, Jan 1, 2024); Short Date (Jan 1, 2024); Numeric Date (01/01/2024); Year Only (2024); Time 12h (1:30 PM); Time 24h (13:30); Date & Time. block.json default: long-date. Saved as `format`.
TimezoneSelect control; the chosen value is saved on the block. Options: Site Timezone; UTC; Custom. block.json default: site. Saved as `timezone`.
Custom TimezoneSelect control; the chosen value is saved on the block. block.json default: UTC. Saved as `customTz`.
Live Clock (auto-update)On/off toggle in the inspector. Off by default. Saved as `liveClock`.
Prefix TextText field in the inspector. Saved as `prefix`.
Suffix TextText field in the inspector. Saved as `suffix`.
HTML TagSelect control; the chosen value is saved on the block. Options: span; p; div. block.json default: span. Saved as `tag`.
Text & Style — AlignmentSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: left. Saved as `align`.
Typography — TextShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoText`.
Text ColorColor control in the inspector. Saved as `textColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Dynamic Date block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Dynamic Date”. It sits under Blog. After insert, open Date Settings and set “Format”, “Timezone”, “Custom Timezone”, “Live Clock (auto-update)”.

What makes Dynamic Date different from other Blockenberg blocks?

Outputs the current date, time or copyright year automatically, with live clock option. Inspector labels on this block include “Format”, “Timezone”, “Custom Timezone”, “Live Clock (auto-update)”.

Is the Dynamic Date Gutenberg block free?

Yes. Dynamic Date ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Dynamic Date to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Date Settings, Text & Style, Color).

Related blog blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Dynamic Date from the Gutenberg inserter.

Get Blockenberg