r/SQL • • Sep 25 '26

Discussion Using DateAdd for timestamps

I am making updates to some older reports and come across this line (or similar) often:

DateAdd(hh, 0, GetDate())

Why do you do that? Is there a legitimate reason why you couldn’t just write GetDate()?

7 Upvotes

19 comments sorted by

View all comments

Show parent comment

3

u/magicaltrevor953 Sep 25 '26

Could also be a way to get around daylight savings, +1 when you need to and then change to 0 when not needed, instead of changing the entire line each time you only change one character.