c # date and format conversion between character (for serial number)

 class Program 
    { 
        static  void the Main ( String [] args) 
        { 
           // Date into character format output 
           String A = " CL " + DateTime.Now.ToString ( " yyyyMMddHHmmssms " ); 
           Console.WriteLine (A); 
            // The character format output character into 
           the DateTime dt = DateTime.ParseExact ( " 201910090914351435 " , " yyyyMMddHHmmssms " , System.Globalization.CultureInfo.CurrentCulture); 
           Console.WriteLine (dt); 
           the Console.ReadKey ();  
        }
    }

 

 

Guess you like

Origin www.cnblogs.com/fzqm-lwz/p/11639538.html