Construct DateTime using today's date at a specific time

后端 未结 4 1413
春和景丽
春和景丽 2020-12-31 15:43

I\'d like to get 4:30 PM of the current day. Hard-coding this way doesn\'t work:

SELECT \'07242012 16:30:00.000\'

This is proving to be mor

4条回答
  •  暖寄归人
    2020-12-31 16:20

     select(dateadd(day, datediff(day, 0, getdate()), 0) + '20:00') as specified_date
    

    specified_date - Output Column name

    20:00 - Specified time(24 hr Format -Default)

    getdate() - To get Today's date.

提交回复
热议问题