Friday, December 12, 2014

DateTime


Looks simple enough: I now have two digital clocks that show current time,
the first for Montreal, the second for Barcelona. I need to go into design mode to produce a visually compelling interface to frame this information.

In fact, the code for each was taken from a different tutorial. Each uses the DateTime class in 
Visual Studio. For the first:




The second was adapted form Home and Learn, UK. The code is quite lean:

In effect, the first creates a new timer object and fills it with DateTime data. 

For the time to show as 24-hour, one's computer needs to be set that way because DateTime
gets the computer's own settings. Which argues that, should one use the app from another country,
one needs to be careful...

The best solution, clearly, is to think it terms of Utc:




No comments: