DatePart
The DatePart function allows to extract a single piece of
information from a date or datetime value. This is extremely
useful if you are working with dates and need to take them apart
and examine individual parts of the date.
Dim nDay, nMonth, nYear
nDay = DatePart("d", Now()) nMonth = DatePart("m", Now()) nYear = DatePart("yyyy", Now())
| Unit |
Meaning |
| d |
Day |
| m |
Month |
| yyyy |
Year |
| q |
Quarter |
| w |
Weekday |
| ww |
Week of Year |
| h |
Hour |
| n |
Minute |
| s |
Second |
|
 |

|