Get current date and time with timezone in wordpress

Get current date and time with timezone in wordpress

<?php
  $timezone     = wp_timezone_string(); //Get the timezone
  $today_date   = get_date_from_gmt($timezone,date("Y-m-d"));
  $current_time = current_time( "H:i:s", $gmt = 0 );

  // Echo the variable and enjoy
?>

 

Leave a Reply

Your email address will not be published. Required fields are marked *