php - get global UTC time without relying on server time -



php - get global UTC time without relying on server time -

i wonder if it's possible global utc time without relying on server time (or in case on pc time).

as now, if

date('h:i:s')

i pc time (the alter gmt+3 or gmt+2 set in app itself) if alter pc time 2 hours , 23 minutes back, date() function result 2 hours , 23 minutes back.

is possible pull global utc time regardless of own pc watch?

@cheery provided nice link in question comments, of it's 2014 outside - makes sense utilize modern tools that:

$dt = new datetime('now', new datetimezone('utc')); echo $dt->format('d-m-y h:i:s');

and answering question:

is possible pull global utc time regardless of own pc watch?

no, php expects local clock + os/php timezone settings correct.

references:

http://php.net/manual/en/datetime.construct.php http://php.net/manual/en/datetime.format.php

php date

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -