Using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace Xiao
6{
7/**////<summary>
8///Create by Huanglin
9///</summary>
Class Program
11 {
static void Main (string[] args)
13 {
Try
15 {
DateTime D;
DateTime Dnow;
Dnow = System.DateTime.Now;
String strdatetime = dnow.tostring ("Yyyymmddhhmmss");
Console.WriteLine ("Current time (normal display):" + dnow.tostring ("yyyy mm month DD Day hh when mm minute ss seconds"));
Console.WriteLine ("Current Time:" +strdatetime);
D = datetime.parseexact (Strdatetime, "Yyyymmddhhmmss", System.Globalization.CultureInfo.CurrentCulture);
Console.WriteLine ("Conversion time (normal display):" +d.tostring ("yyyy mm month DD Day hh when mm minute ss seconds"));
Console.WriteLine ("Conversion Time:" + d.tostring ("Yyyymmddhhmmss"));
25}
-catch (Exception exp)
27 {
System.Console.WriteLine (exp. message);
29}
30}
31}
32}