I am trying to create an Windows 10 IoT app running headless on a Raspberry Pi 2. Everything is set up correctly and I am able to debug my from Visual Studio using the Raspberry
If your app is running headless, you will have to set data to a display device (LCD, LEDs, etc.). With a headed app, you will use a XAML page to display the clock. You can use a timer to get notified every time span occurs.
Timer declaration
ThreadPoolTimer _clockTimer = null;
Timer initialization
_clockTimer = ThreadPoolTimer.CreatePeriodicTimer(_clockTimer_Tick, TimeSpan.FromMilliseconds(1000));
Timer tick event
private void _clockTimer_Tick(ThreadPoolTimer timer)
{
//Update your display. Use a dispatcher if needed
}
ThreadPoolTimer reference documentation
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.system.threading.threadpooltimer.aspx
Keep in mind that a Raspberry Pi does not have a battery to save the current time. Your board will have to sync through the Internet to update its date/time.