Returns the specified component of the specified date.
Copy Code |
---|
int DatePart ( |
The part parameter can have the following values:
Parameter Value | Description |
---|---|
y | Returns the year component of date. |
m | Returns the month component of date. |
d | Returns the day component of date. |
h | Returns the hour component of date. |
n | Returns the minute component of date. |
s | Returns the second component of date. |
You can use the DatePart function to obtain a specific component of a date. For example, you can use DatePart to obtain the month of a particular date.
Date & Time Functions
DateAdd Function
DateDiff Function
Month Function
Day Function
Hour Functinon
Minute Function
Second Function