yyyyMMdd HHmmss To MM/dd/yyyy hh:mm:ss tt

Posted on 2006-05-05
Last Modified: 2012-06-21
I have a date in
"yyyyMMdd HHmmss"
format and I need to convert it to
"MM/dd/yyyy hh:mm:ss tt"
format, is there an easy method in VB.NET to do this? or do I need to write my own parsing function?
Question by:davidtrina
    LVL 7

    Expert Comment

    LVL 3

    Accepted Solution

           Dim strOrigDate As String = "20060505 125555"
            Dim myCIintl As New Globalization.CultureInfo("en-US", False)
            Dim dtNewDate As DateTime = DateTime.ParseExact(strOrigDate, "yyyyMMdd HHmmss", myCIintl)
            Dim strNewDate As String = Format(dtNewDate, "MM/dd/yyyy hh:mm:ss tt")
    LVL 5

    Expert Comment

    LVL 1

    Author Comment

    upped the points to show appreciation

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    733 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

    23 Experts available now in Live!

    Get 1:1 Help Now