Solved

Convert String to DateTime in C#

Posted on 2009-04-08
1
2,838 Views
Last Modified: 2013-12-17
I have the following String:

20090408160428

How can I convert this to a regular DateTime. Is there any Method to do this, or do i have to get the different values (e.g. year) with the Substring methods and create my own formatted string

0
Comment
Question by:schubduese
1 Comment
 
LVL 6

Accepted Solution

by:
Cebik earned 250 total points
ID: 24098023

DateTime data = DateTime.ParseExact("20090408160428", "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
LINQ question 7 22
Refresh Datagridview from another form 1 28
Limiting string to two deciamls 18 32
Round a string to two digits 12 24
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now