• Login

DataSoft Corporation

DATEPART (datepart, date_exp)

Returns an integer that represents the datepart of date_exp. For example, a datepart month returns an integer representing the month (January = 1, December = 12). A datepart weekday returns an integer representing the day of the week (Sunday = 1, Saturday = 7).

Datepart is the part of the date to return, and must be one of the following values.

year
quarter
month
day
dayofyear
week
weekday
hour
minute
second
millisecond 
TZoffset

The TZoffset value returns a time zone offset in number of minutes (signed). The DATEPART function with TZoffset works only with SYSDATETIMEOFFSET() and string literals containing a time zone offset. The time zone offset range is from -14:00 through +14:00. See Examples.

Date_exp is an expression that returns a DATETIME value, a value that can be implicitly converted to a DATETIME value, or a character string in a DATE format.

Thursday, 18 April 2019 Posted in Time and Date Functions
 DataSoft Store  Knowledgebase  Contact Us
 Sitemap  Privacy Policy
    Customer Service


Copyright © 2019 DataSoft Corporation All rights reserved.