$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
echo date( "{$date_format} {$time_format}", current_time( 'timestamp' ) );
ASKER
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script>
$(function(){
$('.result').text(getUTCDifference() );
});
function getUTCDifference() {
var d = new Date();
var n = d.getTimezoneOffset();
var h = n / 60; // hours
var f = h.toFixed(2); // http://www.timeanddate.com/time/time-zones-interesting.html
return f; // in hours, 2 decimal places
}
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="result"></div>
<div>
<p>Your time zone is offset by <span class="result"></span> hours</p>
</div>
</body>
</html>
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY