Snippets
03

Declare @todays_date Date
set @todays_date = CAST(SYSDATETIMEOFFSET() AT TIME ZONE 'Eastern Standard Time' AS date)

For example, if you want the current date and time as a datetime value like GETDATE() does, do this:

CAST(SYSDATETIMEOFFSET() AT TIME ZONE 'Eastern Standard Time' AS datetime)

If you want the current date and time as a datetime2 value like SYSDATETIME() does, do this:

CAST(SYSDATETIMEOFFSET() AT TIME ZONE 'Eastern Standard Time' AS datetime2)

And if you just want the current date, you can do this:

CAST(SYSDATETIMEOFFSET() AT TIME ZONE 'Eastern Standard Time' AS date)

Post Rating

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.

  120 OLD FREEMANS WAY, BREWSTER, MA 02631
  P. O. BOX 2342, BREWSTER, MA 02631
  (774) 323-3176
  CONTACT US