Skip to content

Local time

Hi,

We enabled ntp for update time on PLC and that works fine.

The problem is that the log-files entries is not using this time.

Is it possible to set the plc to use the local time instead?

Best regards Stefan

Comments

  • Hi Stefan,

    The Output.log file timestamps all records with Universal time, and this can't be changed at the moment (sorry). If this is important, please raise this with your local Phoenix Contact support people, who can suggest this as a requirement for a future firmware version, if necessary.

    ~ Martin.

  • Strange, Martin... are you sure?

    I have managed to change the local time on the controller with basic Linux knowledge:

    Login via SSH to the controller and run:

    su <span class="c1"># insert the root password</span>
    nano /etc/timezone
    <span class="c1"># Replace Universal with: Europe/Amsterdam</span>
    /etc/init.d/ntpd status
    <span class="c1"># Check that it is running, if not:</span>
    /etc/init.d/ntpd start
    
    ls -l /etc/localtime
    <span class="c1"># lrwxrwxrwx 1 root root 29 Mar  9  2018 /etc/localtime -> /usr/share/zoneinfo/Universal</span>
    rm -rf /etc/localtime
    ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
    <span class="c1"># Check the link is created and the time is right</span>
    ls -l /etc/localtime
    date

     

  • Yes, of course it is possible to change the time zone.

    But, unless I am missing something, this does not change the timestamps in the Output.log file, which are always in Universal time.

  • Indeed you are right Martin. The Output.log file is stuck with Universal time.

    What are the technical reasons for that? Why not bind the time of the logger with the Linux distribution internal time stamp?

  • I'm not sure of the reason for that design decision. It does sort of make sense - since there is no time zone information shown with the timestamps in the Output.log file, the assumption must be that it is Universal time. The alternative would be to indicate the timezone with each timestamp value in the Output.log file. If this is a requirement for your application, please raise this with your automation support contact in your local Phoenix Contact office, and they can start the internal processes here if necessary.

    ~ Martin.

Sign In or Register to comment.