Menu

#1353 Put system current time in the application header

open
nobody
None
1
2017-11-09
2017-11-02
Anonymous
No

Hello!
Is posible to put the system current time in the application header?, this because in the users computers is not always the same than the system and this is a dificult for the users to understand it.
Thanks!

Discussion

  • Anonymous

    Anonymous - 2017-11-07

    It's quite easy with php to add the time... but it wont get updated, the time will only show for when the page was loaded. To update the time the page needs to be re-loaded. A convenient place to add the single line needed is in the appropriate session include file for your system. For me that is session_remote_user.inc, where I can add just before the closing brace of the function PrintLogonBox:

    echo "Time: " . date("h:i:sa");
    

    The time appears in the header just below the logout link. Since each session type has it's own code for generating the header, I don't think there's a single place that you could put such code that would then work for every session type...

     
  • John Beranek

    John Beranek - 2017-11-07

    If you want it to work in different languages, that should be:

    echo get_vocab("time").utf8_strftime(": %H:%M:%S");
    
     

    Last edit: John Beranek 2017-11-07
  • Campbell Morrison

    If you haven't found it already, you can also set

    $display_timezone = true;
    

    in your config file, which may help to some extent.