0

Server: CentOS, Apache, PHP 7.6

I want to display the last modified time on my webpage.

Now I use:

<?php $lastmodified = filemtime("index.php"); ?>
Last modified on <?php echo date("Y/m/d", $lastmodified);?> at <?php echo date("H:i", $lastmodified); ?>

However, this displays the date in the serverTime in UTC. How would I do this to change all dates(if I use more) to the client time (preferably client side via JS)?

No JQuery please.

Convert date to another timezone in JavaScript Does not explain how to set it to the client time automatically, do the change for all possible timestamps, uses a full string, is not split like my date time.

MeRay
  • 3
  • 1

0 Answers0