DateTime format to SQL format using C#

前端 未结 15 1191
伪装坚强ぢ
伪装坚强ぢ 2020-11-28 02:47

I am trying to save the current date time format from C# and convert it to an SQL Server date format like so yyyy-MM-dd HH:mm:ss so I can use it for my UP

15条回答
  •  -上瘾入骨i
    2020-11-28 03:18

    if you want to store current date in table so you can use

    GETDATE();

    or pass this function as a parameter

    eg. 'update tblname set curdate=GETDATE() where colname=123'

提交回复
热议问题