custom date time format

后端 未结 3 415
情话喂你
情话喂你 2021-01-21 10:24

i need to format date like \"2010-04-21 11:35:22.440\". can anyone help me?

the problem is i am seeing either 2009-06-15T13:45:30.0900000 or 2008-03-09 16:05:07Z but not

3条回答
  •  感情败类
    2021-01-21 11:09

    Use the format "yyyy-MM-dd hh:mm:ss.fff" with the ToString of the date variable.

    e.g:

    Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
    

提交回复
热议问题