PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.11.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.11.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Core / wordpress / date.php

date.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.11.1, at back/Core/wordpress/date.php

38 lines 878 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function acym_getTimeOffsetCMS(): int
4 {
5 static $timeoffset = null;
6 if ($timeoffset === null) {
7 $timeoffset = str_replace('.', ':', acym_getCMSConfig('offset'));
8
9 if (!is_numeric($timeoffset)) {
10 $timezone = new DateTimeZone($timeoffset);
11 $timeoffset = $timezone->getOffset(new DateTime());
12 }
13 }
14
15 return $timeoffset;
16 }
17
18 function acym_dateTimeCMS(int $time)
19 {
20 return date('Y-m-d H:i:s', $time);
21 }
22
23 function acym_getDateTimeFormat(string $default = ''): string
24 {
25 $noTimeDate = [
26 'ACYM_DATE_FORMAT_LC1',
27 'ACYM_DATE_FORMAT_LC3',
28 'ACYM_DATE_FORMAT_LC4',
29 'ACYM_DATE_FORMAT_LC5',
30 ];
31
32 $dateFormat = get_option('date_format', 'Y-m-d');
33
34 $timeFormat = in_array($default, $noTimeDate) ? '' : ' '.get_option('time_format', 'H:i');
35
36 return $dateFormat.$timeFormat;
37 }
38