{"id":962,"date":"2019-10-24T14:55:26","date_gmt":"2019-10-24T13:55:26","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=962"},"modified":"2022-09-13T15:42:32","modified_gmt":"2022-09-13T14:42:32","slug":"read-the-sytem-clock","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/date-and-time-uwp-programming-in-c\/read-the-sytem-clock","title":{"rendered":"Read the sytem clock"},"content":{"rendered":"\n<p><em>For applications which are not network connected on hardware such as the Raspberry Pi without a RTC, will you use the system clock or your own RTC hardware to read time????<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Get current time string<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>DateTime.Now.ToString(\"HH:mm:ss\")\n\nDateTime.Now.ToString(\"HH:mm:ss\", System.Globalization.DateTimeFormatInfo.InvariantInfo)<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Get current time as variables<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\tSystem.DateTime DateTimeNow = DateTime.Now;\n\tint Year = DateTimeNow.Year;\n\tint Month = DateTimeNow.Month;\n\tint RtcDayOfMonth = DateTimeNow.Day;\n\tint Hour = DateTimeNow.Hour;\n\tint Minute = DateTimeNow.Minute;\n\tint Second = DateTimeNow.Second;\n\tint Millisecond = DateTimeNow.Millisecond;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>For applications which are not network connected on hardware such as the Raspberry Pi without a RTC, will you use the system clock or your own RTC hardware to read time???? Get current time string Get current time as variables<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[138],"tags":[],"class_list":["post-962","post","type-post","status-publish","format-standard","hentry","category-date-and-time-uwp-programming-in-c"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=962"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/962\/revisions"}],"predecessor-version":[{"id":1191,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/962\/revisions\/1191"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}