VB.NET : DateTime
Top 35 VB.NET Example Pages...

["swr. X(Y47F*`CST~~}T~~P6464646464646464FhCS}T~~}T~~","DateTime.Parse."," A String contains a date or time. We want to convert it into a DateTime instance in VB.NET. The DateTime.Parse Function handles many different formats of String dates. It is flexible and useful.","Example."," First, this example uses the DateTime.Parse Function. You must pass a string value as its argument. Then, you can assign a DateTime to its result. This transforms the string into a value indicating the DateTime. ","VB.NET program that uses DateTime.Parse function","\n\nModule Module1\n Sub Main()\n Dim value As String = ","\"2000-02-02\"","\n Dim time As DateTime = ","DateTime.Parse","(value)\n Console.WriteLine(time)\n End Sub\nEnd Module\n\n","Output","\n\n2/2/2000 12:00:00 AM","Default time."," You can see in this example that the year, month, and day were correctly parsed. However, the time was left at zero (equivalent to 12 AM), because none was specified. When you don't specify a time it is left at 12 AM.","Example 2."," Next, we examine the DateTime.Parse function using a variety of input formats. For completeness, I searched the Internet to find different DateTime format strings, and then passed them to the DateTime.Parse function. ","Note: ","This function appeared to work correctly on all of the input strings, which means it is fairly flexible.","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","VB.NET program that uses DateTime.Parse in examples","\n\nModule Module1\n Sub Main()","\n ' Simple slash format\n ","Dim time As DateTime = DateTime.Parse(","\"1/1/2000\"",")\n Console.WriteLine(time)","\n\n ' HTTP header\n ","time = DateTime.Parse(","\"Fri, 27 Feb 2009 03:11:21 GMT\"",")\n Console.WriteLine(time)","\n\n ' From w3.org\n ","time = DateTime.Parse(","\"2009/02/26 18:37:58\"",")\n Console.WriteLine(time)","\n\n ' From nytimes.com\n ","time = DateTime.Parse(","\"Thursday, February 26, 2009\"",")\n Console.WriteLine(time)","\n\n ' From dotnetperls.com\n ","time = DateTime.Parse(","\"February 26, 2009\"",")\n Console.WriteLine(time)","\n\n ' From ISO Standard 8601 for Dates\n ","time = DateTime.Parse(","\"2002-02-10\"",")\n Console.WriteLine(time)","\n\n ' From Windows file system Created/Modified\n ","time = DateTime.Parse(","\"2/21/2009 10:35 PM\"",")\n Console.WriteLine(time)","\n\n ' From Windows Date and Time panel\n ","time = DateTime.Parse(","\"8:04:00 PM\"",")\n Console.WriteLine(time)\n End Sub\nEnd Module\n\n","Output","\n\n1/1/2000 12:00:00 AM\n2/26/2009 8:11:21 PM\n2/26/2009 6:37:58 PM\n2/26/2009 12:00:00 AM\n2/26/2009 12:00:00 AM\n2/10/2002 12:00:00 AM\n2/21/2009 10:35:00 PM\n6/2/2010 8:04:00 PM","Summary."," The DateTime.Parse function in the VB.NET language is useful in many programs where you want to convert a string into a DateTime instance. The DateTime type provides more options for programmatic use. ","And: ","The string type is more useful for input and output such as writing to files.","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","3679700504","data-ad-format","link","ins","class","adsbygoogle","data-ad-client","ca-pub-4712093147740724","data-ad-slot","6227126509","data-ad-format","auto","url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAABUCAMAAADeZ6kGAAAAYFBMVEX////81Nf4d4P17iv3UmX95edvbCf1K0P6pavMxir5kpr7vsLf2SqYlCiqpSn1MUj17jH38VT7+KnBvCnr5CsmJib///7//v77qbP6sbf+9faCfyj49HL///3//f7+/v6w/yUoAAACZUlEQVR4Xu3a187qMBAEYFzSC73+7f3f8sQwwkJI2Y0UH+xo54qLkfEnQOvIrFbni10XY1nby3mFRFHm56wLOvocU5mfS8HJJaYyP5aFszGV+VmzcOuYyvwUvERSjgAnOMEJTnDlH3JrahbOD0uirNBD1DiufCmXc+Lg01NwZTI4pCZxfs8qahziUKqwzV1nSZz230sSpx7tsigpHAwKzHlxbjMO1xA4vPcdUieEq/HREbhsIGiFnQTAIbPioPzTBM4Oggy/EMYoAA4hcIgOhqsJXD0IrngMqVPDaQKn3Ga1zpykSQdnCdz7k+Ntdlymh9gAuPqOI7ZQv6yjZ8VhFFj4ZsVlnFHQDICmHJI5yjUALsQo0Io1xG8Y3sXVUbLIcPTxiz5RKX9YUiM40Dzvo2fLTBcLxWV45EkJJ0/ighOc4AQnuPRveeR+LuWbVbkTR34ZfyP4jaX88UgkEonktNtuzFg2290pbJnfnmr7NnS+T4HL/Pak7Awnu8BlfntStizcNnCZ356UDQu3CVzmtyfF8BK2zG9/Hic4wQlOcPnxJTmJ69GsxnCuhvRDoXpd/h2HdX36BHDw9EvDPRc++DfJu/+Oy031WK8ncAg+gnGc/yruzcFv+R33vm6fBi531c7s8XKBuNx0zsXEzT8KgEPmwkF0bJ1xz8EhVRq4ryOIebU8nJ92C8S1z/0ycXk15JAG7jnhTMUfBe3ga1PAdQ/bF3D8UZACbo/p/SEcaJ4359kyx+Gk7aecLVPBGczxJeKg6kLh5ElccIITnOAEl/4tj9zPJXyzKnfiyA/jXwQ/gcv89j+gsyv28aCq3QAAAABJRU5ErkJggg==)","url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAACCAgMAAADasxWRAAAADFBMVEX/6Nn///+VlZX29va5ksB5AAAASElEQVR4AWPACZj/f0DmjkqOSjKtQgcLyJccZiEE9SOmP8mXHEaBMBoIo4EwGggryJccvvVKKAogTnJUclRyVHLklgmjkqOSAALWyrsxEHLDAAAAAElFTkSuQmCC)","url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAABZCAMAAAD1qB0CAAAAGFBMVEX///+vr6/Nzc1kZGSNjY3k5OQxMTEAAABgpIToAAADeUlEQVR4Xu1Z23YcIQxbX/n/P273lMYJRSilM4d5qB5DwAIJe7y8NqEi+noeIttPpD6S1xvyMGLZOvKGACqyu19pHTccmfwyyR41L2JGJuwunbEz224jVlv2bWJ4/j4USHGlx454JO66la3g/3Ytr82w0ZAU0hGUWc2+x2ItpolTuZpu5pT/vndzfpSvM3BkMakbcQSGlPTDpTmBksRi9wMoedxiAZQ8bjFFSnqd4xFIKTm3mBwnFnPvxek0ZnOJ83U6jcmOxRTUUj5JKb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