DateTime.ParseExact Example

DateTime.ParseExact Example

DateTime.ParseExact Vb.net example and C#.net example. Convert specified string into dateTime.

[C#] DateTime Parse Exact

c# Date Format
using System;
using System.Globalization;
namespace DateAndTime.Examples
{
class Program
{
static void Main(string[] args)
{
DateTime parseDateString = DateTime.ParseExact("Sun, 01 Jan 2012 13:13:30 GMT", 
"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'", null); Console.WriteLine("Parse Exact date string is {0}", parseDateString); Console.ReadLine(); } } }
VB.net-Program

(VB.net) DateTime.ParseExact Method example.

Imports System.Globalization
Namespace DateAndTime.Examples
Class Program
Private Shared Sub Main(args As String())
Dim parseDateString As DateTime = DateTime.ParseExact("Sun, 01 Jan 2012 13:13:30 GMT",
 "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'", Nothing)
Console.WriteLine("Parse Exact date string is {0}", parseDateString)
Console.ReadLine()
End Sub
End Class
End Namespace
Output

Parse Exact date string is 1/1/2012 1:13:30 PM.

Tags:

C# MemoryStream ExampleDateTime ParseExact Time 10:10:13 AM hh mm ss tt nullC# Recursion ExampleC# HtmlTextWriter ExampleOne dimensional array example C#.net VB.netC# Do While Loop ExampleDateTimeTryParse using C# and VB.net exampleJQuery Hello World ExampleAndroid screen navigation example using Activity and IntentC# Get Random Item From List (VB.net) Example.C# 4.0 Tuple Example

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.