# Set date & time

**URL:** <https://community.br-automation.com/t/set-date-time/7166>\
**Category:** HMI & Visualization\
**Tags:** mapp-view\
**Created:** [June 3, 2025, 7:31am UTC](https://community.br-automation.com/t/set-date-time/7166 "2025-06-03T07:31:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valerio\_C](https://avatars.discourse-cdn.com/v4/letter/v/FF8800/32.png) [@Valerio\_C](https://community.br-automation.com/u/Valerio_C)\
**Post date:** [June 3, 2025, 7:31am UTC](https://community.br-automation.com/t/set-date-time/7166/1 "2025-06-03T07:31:54Z")

</div>

Hi everybody,  
is there a smart way to set date + time of the CPU via mappview? in my beloved visual components it was so easy, just set system time directly with a component.  
Now there are 2 widgets, datetime input and output but I don’t understand why they are there if they can’t set the system time directly.

I just would like a widget where I set the current date+time and then it shows the new value, as any component of that type.

From what I understand, the only way to do it would be via code: when the value of datetime picker changes, set the system time via DTsetTime and then continuously call DTgetTime to show it. But it does not seem so efficient.

Is there a better way?  
thanks

---

<div class="post-metadata">

**Author:** ![kovarj](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/kovarj/32/537_2.png) [@kovarj](https://community.br-automation.com/u/kovarj)\
**Post date:** [June 3, 2025, 7:56am UTC](https://community.br-automation.com/t/set-date-time/7166/2 "2025-06-03T07:56:23Z")

</div>

I would expect that PLC where mappView server runs has a same system time like a client (synchronized to NTP server e.g.) and then it is enough if you just show in visualization system time of client. So you do not need to read cyclically PLC time. You are right that if you would like to change system time on PLC side, you have to bind DateTime variable and call respective function to change the time. It is not done automatically.

---

<div class="post-metadata">

**Author:** ![Simon\_Stoll](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/simon_stoll/32/445_2.png) [@Simon\_Stoll](https://community.br-automation.com/u/Simon_Stoll)\
**Post date:** [June 3, 2025, 8:29am UTC](https://community.br-automation.com/t/set-date-time/7166/3 "2025-06-03T08:29:29Z")

</div>

Hi Valerio,

what we did in our project is a DateTimeInput which updates time in HMI until users sets it from HMI. Then time of PLC will be set.

1. Create DateTimeInput DISystemTime
2. Bind value to PLC var DesiredTime (DATE\_AND\_TIME) twoWay
3. Events on DISystemTime:
  1. Click event → set PLC var UpdateDesiredTime to false
  2. ValueChanged event → set PLC var SetTime to true

4. Following PLC code

```auto
CASE SetTimeState OF
	
	0: // check for changes
		IF NOT UpdateDesiredTime THEN // prepare setting time
			
			IF SetTime THEN
				DTSetTime_0.enable := TRUE;
				DTSetTime_0.DT1 := DesiredTime;
				
				SetTimeState := 10;
			END_IF
		ELSE
			SetTimeState := 5;
		END_IF
		
		
	5: // Update desired value in visu				
		
		DesiredTime := current.DateTime.DateTime;	
	
		SetTimeState := 0;
		
			
	10: // set time and wait
		
		IF DTSetTime_0.status = ERR_OK THEN
			SetTimeState := 20;
							
		ELSIF DTSetTime_0.status <> ERR_FUB_BUSY THEN
			SetTimeState := 99;
		END_IF
		
	
	20: // deativate FUB
		DTSetTime_0.enable := FALSE;
		
		SetTime := FALSE;
		UpdateDesiredTime := TRUE;
		
		SetTimeState := 5;		
	
	99: // Error
		
		SetTimeState := 5;	//edge alarm with ack req
	
END_CASE

DTSetTime_0();

```

Maybe this is helpful for you.

Sincerly Simon 🙂

---

<div class="post-metadata">

**Author:** ![Valerio\_C](https://avatars.discourse-cdn.com/v4/letter/v/FF8800/32.png) [@Valerio\_C](https://community.br-automation.com/u/Valerio_C)\
**Post date:** [June 3, 2025, 8:33am UTC](https://community.br-automation.com/t/set-date-time/7166/4 "2025-06-03T08:33:38Z")

</div>

thank you for your reply.  
That’s interesting! so if I set the CPU to act as a NTP server

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/7/79426cc267a15a85be84297fca741494109c470c.png)

the NTP client (display connected via ethernet) will automatically sync with that time?

This would be perfect, I’d just need to set the PLC time once.

But I don’t see how to show the system time of the client via mapp view directly without using code, the only available value is  
 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/d/d329edba534965f894ff2d3f80b402244b094817.png)  
which does not look like the current system time…

---

<div class="post-metadata">

**Author:** ![Valerio\_C](https://avatars.discourse-cdn.com/v4/letter/v/FF8800/32.png) [@Valerio\_C](https://community.br-automation.com/u/Valerio_C)\
**Post date:** [June 3, 2025, 8:39am UTC](https://community.br-automation.com/t/set-date-time/7166/5 "2025-06-03T08:39:15Z")

</div>

thank you for adding your code.  
this is more or less what I’m doing right now, but I thought there would be a quicker way directly from mappview.

I find really frustrating that B&R upgraded the HMI design by moving to mappview and still make things so much complicated than with visual components. Setting/viewing system time was just 1 click!

---

<div class="post-metadata">

**Author:** ![kovarj](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/kovarj/32/537_2.png) [@kovarj](https://community.br-automation.com/u/kovarj)\
**Post date:** [June 3, 2025, 8:55am UTC](https://community.br-automation.com/t/set-date-time/7166/6 "2025-06-03T08:55:40Z")

</div>

It is very easy. Local time of the client is shown automatically, you do not need to bind anything.

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/4/470365a1ee255ac45dd6aa663729d41c9ab51c1b.png)

---

<div class="post-metadata">

**Author:** ![Valerio\_C](https://avatars.discourse-cdn.com/v4/letter/v/FF8800/32.png) [@Valerio\_C](https://community.br-automation.com/u/Valerio_C)\
**Post date:** [June 3, 2025, 9:14am UTC](https://community.br-automation.com/t/set-date-time/7166/7 "2025-06-03T09:14:19Z")

</div>

ah I see!!!  
perfect so that’s it.  
thank you very much Jaroslav

---

<div class="post-metadata">

**Author:** ![kovarj](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/kovarj/32/537_2.png) [@kovarj](https://community.br-automation.com/u/kovarj)\
**Post date:** [November 6, 2025, 2:44pm UTC](https://community.br-automation.com/t/set-date-time/7166/8 "2025-11-06T14:44:25Z")

</div>

A post was split to a new topic: [Why is my NTP server returning wrong time](https://community.br-automation.com/t/why-is-my-ntp-server-returning-wrong-time/8924)

---

<div class="post-metadata">

**Author:** ![whyleys](https://avatars.discourse-cdn.com/v4/letter/w/FF8800/32.png) [@whyleys](https://community.br-automation.com/u/whyleys)\
**Post date:** [August 21, 2026, 2:38pm UTC](https://community.br-automation.com/t/set-date-time/7166/9 "2026-08-21T14:38:26Z")

</div>

Hello, I am still getting a little confused by this. We send machines all across the world and I’d like the user to set the time from engineering like they did in VC4 as I don’t always have access to do it through AS.

I’m using mappView C80 and AS6.5.3.11, NTP server client disabled on CPU config, I’ve had a play and I set the time using DTSetTime but the time then switches back to the original time. I just want to be able to set via mappView locally on the C80.

---

<div class="post-metadata">

**Author:** ![Valerio\_C](https://avatars.discourse-cdn.com/v4/letter/v/FF8800/32.png) [@Valerio\_C](https://community.br-automation.com/u/Valerio_C)\
**Post date:** [August 24, 2026, 7:40am UTC](https://community.br-automation.com/t/set-date-time/7166/10 "2026-08-24T07:40:43Z")

</div>

> [@whyleys](#):
>
> NTP server client disabled on CPU config, I’ve had a play and I set the time using DTSetTime but the time then switches back to the original time. I just want to be able to set via mappView locally on the C80

I completely agree with you, mappview is a real pain to work with, if compared with VC4.

But, as we discussed above, you have to enable NTP server, so that the client will get the time from the server (the CPU). If you use DTSetTime it will change the time on CPU side, but the client will still work on its own .

---

<div class="post-metadata">

**Author:** ![whyleys](https://avatars.discourse-cdn.com/v4/letter/w/FF8800/32.png) [@whyleys](https://community.br-automation.com/u/whyleys)\
**Post date:** [August 24, 2026, 8:07am UTC](https://community.br-automation.com/t/set-date-time/7166/11 "2026-08-24T08:07:20Z")

</div>

Thank you for that summary Valerio, I will give it a try. 😃
