To Time - CSharp System

CSharp examples for System:DateTime Time

Description

To Time

Demo Code


using System.Globalization;
using System;/*w w w  .  j a  v a2s  . c om*/

public class Main{
        public static DateTime ToTime(this string stringTime)
        {
            return DateTime.ParseExact(stringTime,
                new[] {"hhmmss", "hh:mm:ss"},
                null, DateTimeStyles.None);
        }
}

Related Tutorials