{"id":1400,"date":"2011-08-29T12:48:35","date_gmt":"2011-08-29T16:48:35","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=1400"},"modified":"2011-11-11T11:15:13","modified_gmt":"2011-11-11T15:15:13","slug":"vb-net-date-and-time-format","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2011\/08\/vb-net-date-and-time-format\/","title":{"rendered":"VB.NET date and time format"},"content":{"rendered":"<blockquote><p>\nDate as Monday, August 29, 2011<\/p><\/blockquote>\n<pre>\r\n<code>\r\nProtected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load\r\n    Dim dd As Date = Date.Today\r\n    label1.Text = String.Format(\"{0:dddd, MMMM d, yyyy}\", dd)\r\n\r\nEnd Sub\r\n<\/code>\r\n<\/pre>\n<blockquote><p>\nOther formats&#8230;<\/p><\/blockquote>\n<pre>\r\n<code>\r\n' - month\/day numbers without\/with leading zeroes\r\nString.Format(\"{0:M\/d\/yyyy}\", dt);            ' \"8\/29\/2011\"\r\nString.Format(\"{0:MM\/dd\/yyyy}\", dt);          ' \"08\/29\/2011\"\r\n\r\n' - day\/month names\r\nString.Format(\"{0:ddd, MMM d, yyyy}\", dt);    ' \"Sun, Aug 29, 2011\"\r\nString.Format(\"{0:dddd, MMMM d, yyyy}\", dt);  ' \"Sunday, August 29, 2011\"\r\n\r\n' - two\/four digit year\r\nString.Format(\"{0:MM\/dd\/yy}\", dt);            ' \"08\/29\/11\"\r\nString.Format(\"{0:MM\/dd\/yyyy}\", dt);          ' \"09\/29\/2011\"\r\n<\/code>\r\n<\/pre>\n<blockquote><p>\n&#8230; and more formats<\/p><\/blockquote>\n<pre>\r\n<code>\r\nString.Format(\"{0:t}\", dt);  ' \"11:31 AM\"                        \r\n                             ' ShortTime\r\nString.Format(\"{0:d}\", dt);  ' \"8\/29\/2011\"\r\n                             ' ShortDate\r\nString.Format(\"{0:T}\", dt);  ' \"11:31:12 AM\"\r\n                             ' LongTime\r\nString.Format(\"{0:D}\", dt);  ' \"Monday, August 29, 2011\"\r\n                             ' LongDate\r\nString.Format(\"{0:f}\", dt);  ' \"Monday, August 29, 2011 11:31 AM\"\r\n                             ' LongDate+ShortTime\r\nString.Format(\"{0:F}\", dt);  ' \"Monday, August 29, 2011 11:31:12 AM\" \r\n                             ' FullDateTime\r\nString.Format(\"{0:g}\", dt);  ' \"8\/29\/2011 11:31 PM\"\r\n                             ' ShortDate+ShortTime\r\nString.Format(\"{0:G}\", dt);  ' \"3\/9\/2008 4:05:07 PM\"\r\n                             ' ShortDate+LongTime\r\nString.Format(\"{0:m}\", dt);  ' \"August 29\"                        \r\n                             ' MonthDay\r\nString.Format(\"{0:y}\", dt);  ' \"August, 2011\"                     \r\n                             ' YearMonth\r\nString.Format(\"{0:r}\", dt);  ' \"Mon, 29 Aug 2011 14:27:52 GMT\"   \r\n                             ' RFC1123\r\nString.Format(\"{0:s}\", dt);  ' \"2011-08-29T14:27:52\"             \r\n                             ' SortableDateTime\r\nString.Format(\"{0:u}\", dt);  ' \"2011-08-29 14:27:52Z\"\r\n                             ' UniversalSortableDateTime\r\n<\/code>\r\n<\/pre>\n<p><strong>View related posts<\/strong><br \/>\n&#8211; <a href=\"http:\/\/www.iowawebnet.com\/ein\/2011\/09\/vb-net-date-in-code-behind\/\">VB.NET \u2013 Date in code behind<\/a><br \/>\n&#8211; <a href=\"http:\/\/www.iowawebnet.com\/ein\/2011\/11\/month-day-and-year-code-behind-format\/\">Month, day and year code behind format<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Date as Monday, August 29, 2011 Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim dd As Date = Date.Today label1.Text = String.Format(&#8220;{0:dddd, MMMM d, yyyy}&#8221;, dd) End Sub Other formats&#8230; &#8216; &#8211; month\/day numbers without\/with leading zeroes String.Format(&#8220;{0:M\/d\/yyyy}&#8221;, dt); &#8216; &#8220;8\/29\/2011&#8221; String.Format(&#8220;{0:MM\/dd\/yyyy}&#8221;, dt); &#8216; &#8220;08\/29\/2011&#8221; &#8216; &#8211; day\/month names String.Format(&#8220;{0:ddd, MMM d, [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,16,57],"tags":[19,58,60,59],"class_list":["post-1400","post","type-post","status-publish","format-standard","hentry","category-applications","category-net","category-date-and-time-format","tag-asp-net","tag-date","tag-format","tag-time"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/1400"}],"collection":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/comments?post=1400"}],"version-history":[{"count":13,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/1400\/revisions"}],"predecessor-version":[{"id":1463,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/1400\/revisions\/1463"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=1400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=1400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=1400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}