Articles in this section
Category / Section

How to set custom time in the DigitalClock and AnalogClock?

1 min read

In the Clock, you can set custom time depending upon the needs, by enabling the ShowCustomTimeClock property. Additionally, the custom time should be specified to be shown in the Analog and Digital clocks by using the CustomTime property of the Clock.

 

The following code example demonstrates the same.

C#

// Shows the custom time.
this.clock1.ShowCustomTimeClock = true;
// Sets the custom time for the clock.
this.clock1.CustomTime = new DateTime(2015, 7, 21, 05, 00, 00);

 

VB

'Shows the custom time.
Me.clock1.ShowCustomTimeClock = True
'Sets the custom time for the clock.
Me.clock1.CustomTime = New DateTime(2015, 7, 21, 05, 00, 00)

Analog and Digital clock with custom time

Figure 1: Analog clock and Digital clock with custom time

Sample Links:

C#: Clock_CustomTime_C#

VB: Clock_CustomTime_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied