-
-
Notifications
You must be signed in to change notification settings - Fork 510
Closed
Description
Is your feature request related to a problem?
current_time()
with timestamp
or U
format produces a "WordPress timestamp", a sum of Unix timestamp and current time zone offset.
While historically entrenched in core, the use of such timestamps is deeply problematic and we are working on eliminating them in favor of real Unix timestamps and full interoperability with PHP.
Describe the solution you'd like
current_time( 'timestamp', true )
/current_time( 'U', true )
are equivalent totime()
and should be replaced with itcurrent_time( 'timestamp' )
/current_time( 'U' )
should be discouraged in favor of requesting non-timestamp format, or otherwise refactoring the usage
Additional context (optional)
The use of current_time( 'timestamp' )
had been mostly eliminated from core in #40657. Minimal usage in unit tests and older functions that must operate with WP timestamps for backwards compatibility reasons remains.