Replacement for current_time( ‘timestamp’ )
-
Hi,
While reading the thread about date/time improvements I notice it’s discouraged to use the
current_time( 'timestamp' )
.This function returns the local timestamp. I need that. But I cannot find a replacement for this, that returns a timestamp with local timezone included.
Have tried the new
current_datetime()
function but that one does not return a timestamp. So by usingstrtotime()
I can generate a timestamp:$obj = current_datetime(); $array = get_object_vars($obj); $my_current_time = strtotime($array['date']);
But timezone can be different when some plugin/theme sets another one by using function
date_default_timezone_set()
. So this I cannot fully trust.Who can help me with this?
Guido
- The topic ‘Replacement for current_time( ‘timestamp’ )’ is closed to new replies.