<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>

<script type="text/javascript">
  
  en4.core.runonce.add(function() {
    var updateClock = function() {
      var currentTime = new Date();
      currentTime.setMilliseconds(currentTime.getMilliseconds() + Date.getServerOffset());

      var currentHours = currentTime.getHours ( );
      var currentMinutes = currentTime.getMinutes ( );
      var currentSeconds = currentTime.getSeconds ( );

      // Pad the minutes and seconds with leading zeros, if required
      currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
      currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

      // Choose either "AM" or "PM" as appropriate
      var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

      // Convert the hours component to 12-hour format if needed
      currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

      // Convert an hours component of "0" to "12"
      currentHours = ( currentHours == 0 ) ? 12 : currentHours;

      // Compose the string for display
      var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;

      //currentTimeString += ' (' + currentTime.getTimezone() + ')';

      // Update the time display
      scriptJquery("#clock").html(currentTimeString);
    }
    
    setInterval(updateClock, 1000);
  });
</script>

<style type="text/css">
  .layout_clock > div
  {
    text-align: center;
    padding: 15px;
    margin-bottom: 15px;
  }
  .layout_clock > div > span
  {
    display: block;
    font-size: 1.4em;
  }
</style>

<div class="quicklinks">
  <span id="clock">&nbsp;</span>
</div>
