??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/mayshine.co.uk/wp-content/plugins/wpforms-lite/includes/functions/date-time.php
⬅ Kembali
<?php
/**
* Helper functions to work with dates, time and timezones.
*
* @since 1.8.0
*/
/**
* Return date and time formatted as expected.
*
* @since 1.6.3
*
* @param string|int $date Date to format.
* @param string $format Optional. Format for the date and time.
* @param bool $gmt_offset Optional. GTM offset.
*
* @return string
*/
function wpforms_datetime_format( $date, $format = '', $gmt_offset = false ) {
if ( is_numeric( $date ) ) {
$date = (int) $date;
}
if ( is_string( $date ) ) {
$date = strtotime( $date );
}
if ( $gmt_offset ) {
$date += (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
}
if ( $format === '' ) {
return sprintf( /* translators: %1$s - formatted date, %2$s - formatted time. */
__( '%1$s at %2$s', 'wpforms-lite' ),
date_i18n( get_option( 'date_format' ), $date ),
date_i18n( get_option( 'time_format' ), $date )
);
}
return date_i18n( $format, $date );
}
/**
* Return date formatted as expected.
*
* @since 1.6.3
*
* @param string|int $date Date to format.
* @param string $format Optional. Format for the date.
* @param bool $gmt_offset Optional. GTM offset.
*
* @return string
*/
function wpforms_date_format( $date, $format = '', $gmt_offset = false ) {
if ( $format === '' ) {
$format = (string) get_option( 'date_format', 'M j, Y' );
}
return wpforms_datetime_format( $date, $format, $gmt_offset );
}
/**
* Return time formatted as expected.
*
* @since 1.8.5
*
* @param string|int $date Date to format.
* @param string $format Optional. Format for the time.
* @param bool $gmt_offset Optional. GTM offset.
*
* @return string
*/
function wpforms_time_format( $date, $format = '', $gmt_offset = false ) {
if ( $format === '' ) {
$format = (string) get_option( 'time_format', 'g:ia' );
}
return wpforms_datetime_format( $date, $format, $gmt_offset );
}
/**
* Get the certain date of a specified day in a specified format.
*
* @since 1.4.4
* @since 1.6.3 Added $use_gmt_offset parameter.
*
* @param string $period Supported values: start, end.
* @param string $timestamp Default is the current timestamp, if left empty.
* @param string $format Default is a MySQL format.
* @param bool $use_gmt_offset Use GTM offset.
*
* @return string
*/
function wpforms_get_day_period_date( $period, $timestamp = '', $format = 'Y-m-d H:i:s', $use_gmt_offset = false ) {
$date = '';
if ( empty( $timestamp ) ) {
$timestamp = time();
}
$offset_sec = $use_gmt_offset ? get_option( 'gmt_offset' ) * 3600 : 0;
switch ( $period ) {
case 'start_of_day':
$date = gmdate( $format, strtotime( 'today', $timestamp ) - $offset_sec );
break;
case 'end_of_day':
$date = gmdate( $format, strtotime( 'tomorrow', $timestamp ) - 1 - $offset_sec );
break;
}
return $date;
}
Nama
Tipe
Ukuran
Diubah
Aksi
📄 .htaccess
htaccess
237 B
2026-06-23 08:04
🐘 access.php
php
10.8 KB
2026-05-28 15:16
🐘 builder.php
php
1.4 KB
2025-06-17 13:49
🐘 checks.php
php
16.2 KB
2026-06-18 16:16
🐘 colors.php
php
4 KB
2023-11-28 16:59
🐘 data-presets.php
php
19.1 KB
2025-11-06 19:10
🐘 date-time.php
php
2.8 KB
2025-06-05 16:54
🐘 debug.php
php
5.3 KB
2025-08-11 13:38
🐘 education.php
php
2.9 KB
2025-06-17 13:49
🐘 escape-sanitize.php
php
18 KB
2026-06-03 16:18
🐘 filesystem-media.php
php
8.8 KB
2026-06-03 16:18
🐘 form-fields.php
php
19.2 KB
2026-03-19 16:20
🐘 forms.php
php
14.6 KB
2026-05-28 15:16
🐘 list.php
php
6.9 KB
2024-06-13 16:24
🐘 payments.php
php
21.8 KB
2025-07-31 14:13
🐘 plugins.php
php
2.4 KB
2025-06-05 16:54
🐘 privacy.php
php
2.5 KB
2025-02-27 17:40
🐘 providers.php
php
2 KB
2025-06-05 16:54
🐘 utilities.php
php
10.4 KB
2026-06-18 16:16