namespace yyyy_MM_dd_hh_mm
{
    class Program
    {
        static void Main(string[] args)
        { while (true)
{
            try
            {
                Console.WriteLine("请输入您的出生年月日");
               DateTime dt = Convert.ToDateTime(Console.ReadLine());
              string s= dt.ToString("那么您的出生时间为yyyy年MM月dd日");    //yyyy-MM-dd-hh-mm-ss注意这个格式,输出为yyyy年MM月dd日等
              Console.WriteLine(s);
              Console.ReadLine();
            }
         
 catch (Exception)
            {

                Console.WriteLine("请输入正确的出生年月日yyyy-MM-dd");
            }

}

        }
    }
}

相关文章:

  • 2022-03-03
  • 2022-12-23
  • 2021-12-28
  • 2021-05-26
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
相关资源
相似解决方案