How to set the display time to a specific value RRS feed

  • Question

  • I want to synchronize the time on my PC to an external source (a PLC).

    From the PLC I get the time in YYYY, MM, DD, hh, mm, ss.

    Then I want to make the PC display the same time.

    How is that done?

    I found a command SetDateTime - but here I get into UTC and time zone issues....

    All I want is simply make the PC display the time I have from the PLC! The time from the PLC already has the time zone and daylight saving information so it is the correct time as it is!

    Wednesday, October 7, 2015 9:16 AM

All replies

  • Jake,

    In VBA use format function:

    format("2015-10-07 12:16:21" ,"YYYY, MM, DD, hh, mm, ss")

    For computer system, change regional format date and time:



    Wednesday, October 7, 2015 10:22 AM
  • Maybe I was unclear.

    I want to set the time on the PC - and I have the local time = the time I want to be in the PC and to be displayed in the command line ow my Windows system if I go to the desk top..

    I.e. not the UTC time or anything else - simply the "local time" as I have it from my PLC.

    Forget about the format of the time - I am only intrested in the actual time that is displayed.

    Wednesday, October 7, 2015 1:06 PM
  • Hi Jake,

    >> I want to set the time on the PC

    Could you share us why you want to set PC system display time? In my option, it is dangerous behavior to set system setting with code.

    Did you want vba code to set PC system display time? This forum is for Developer discussions and questions involving Microsoft Access, your issue is more related with VBA code, I will move this thread to the more related forum.

    Reference: http://social.msdn.microsoft.com/Forums/en-US/home?forum=isvvba

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 8, 2015 3:28 AM