# ablocks/2.9.0/includes/frontend/dynamic-content/interpreters/current-date-time.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.9.0. 25 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.9.0/code/includes/frontend/dynamic-content/interpreters/current-date-time.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.9.0/raw/includes/frontend/dynamic-content/interpreters/current-date-time.php
- Modified: 2025-04-09T16:19:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ablocks/2.9.0/code/includes/frontend/dynamic-content/interpreters/current-date-time.php#L10-L20`.

```php
<?php
namespace ABlocks\Frontend\DynamicContent\Interpreters;

use ABlocks\Helper;
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
class CurrentDateTime extends Abstracts\Interpreter {
	public function content() : string {
		$format = ( $this->setting[1] === 'custom' ? $this->setting[2] : $this->setting[1] ) . ' ' . ( $this->setting[0] === 'default' ? 'h:i A' : $this->setting[0] );
		$pre = '';
		$post = '';
		$default = $this->setting[3] ?? '';
		if ( count( $this->setting ) > 5 ) {
			$pre  = $this->setting[3] ?? '';
			$post = $this->setting[4] ?? '';
			$default = $this->setting[5] ?? '';
		}
		if ( empty( trim( $format ) ) ) {
			$format = 'd M, Y h:i a';
		}
		return $pre . wp_date( empty( $format ) ? $default : $format ) . $post;
	}
}

```
