Fixed timezone bug in current_time function

This commit is contained in:
Denis Zogu 2024-03-15 15:50:53 +01:00
parent 5a59a56abc
commit af0d25ffe4
1 changed files with 2 additions and 2 deletions

View File

@ -72,8 +72,8 @@ function mysql2date( $format, $date, $translate = true ) {
*/
function current_time( $type, $gmt = 0 ) {
// Don't use non-GMT timestamp, unless you know the difference and really need to.
if ( 'timestamp' === $type || 'U' === $type ) {
return $gmt ? time() : time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
if ( 'timestamp' === $type ) {
$type = 'U';
}
if ( 'mysql' === $type ) {