# acymailing/trunk/back/Core/wordpress/date.php

AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress, version trunk. 41 lines.

- Page: https://pluginprobe.com/plugins/acymailing/trunk/code/back/Core/wordpress/date.php
- Raw: https://pluginprobe.com/plugins/acymailing/trunk/raw/back/Core/wordpress/date.php
- Modified: 2026-08-03T10:18:54+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/acymailing/trunk/code/back/Core/wordpress/date.php#L10-L20`.

```php
<?php

defined('ABSPATH') || die('Restricted Access');

function acym_getTimeOffsetCMS(): int
{
    static $timeoffset = null;
    if ($timeoffset === null) {
        //We replace the . with : WordPress give format like UTC+5.45, but we want something like UTC+5:45
        $timeoffset = str_replace('.', ':', acym_getCMSConfig('offset'));

        if (!is_numeric($timeoffset)) {
            $timezone = new DateTimeZone($timeoffset);
            $timeoffset = $timezone->getOffset(new DateTime());
        }
    }

    return $timeoffset;
}

function acym_dateTimeCMS(int $time)
{
    return gmdate('Y-m-d H:i:s', $time);
}

function acym_getDateTimeFormat(string $default = ''): string
{
    $noTimeDate = [
        'ACYM_DATE_FORMAT_LC1',
        'ACYM_DATE_FORMAT_LC3',
        'ACYM_DATE_FORMAT_LC4',
        'ACYM_DATE_FORMAT_LC5',
    ];

    $dateFormat = get_option('date_format', 'Y-m-d');

    $timeFormat = in_array($default, $noTimeDate) ? '' : ' '.get_option('time_format', 'H:i');

    return $dateFormat.$timeFormat;
}

```
