DatePart Function
ddd
DatePart (interval As String, date As Date [, firstDayOfWeek As Integer [, firstWeekOfYear As Integer]]) As Long
ཕྱིར་ལོག་ཐང་
The extracted part for the given date.
interval - A string expression from the following table, specifying the date interval.
interval (string value)
|
འགྲེལ་པ་
|
yyyy
|
ལོ་
|
q
|
དུས་ཚིགས་
|
m
|
ཟླ་བ་
|
y
|
ལོའི་ནང་གི་ཉིན་ཞིག་ལ་
|
w
|
ལས་ཀའི་ཉིན་
|
ww
|
ལོའི་ནང་གི་རེས་གཟའ་ཞིག་ལ་
|
d
|
ཉིན་
|
h
|
ཆུ་ཚོད་
|
n
|
སྐར་མ་
|
s
|
སྐར་ཆ་
|
date - The date from which the result is calculated.
Date literals allow to specify unambiguous date variables that are independent from the current language. Literals are enclosed between hash signs #. Possible formats are:
-
#yyyy-mm-dd#
-
#mm/dd/yyyy#
firstdayofweek: An optional parameter that specifies the starting day of a week.
firstdayofweek value
|
འགྲེལ་པ་
|
0
|
བཏགས་གྲངས་ཀྱི་ཁས་ལེན་ཐང་བེད་སྤྱོད་
|
1
|
གཟའ་ཉི་མ་(ཁས་ལེན་)
|
2
|
གཟའ་ཟླ་བ་
|
3
|
གཟའ་མིག་དམར་
|
4
|
གཟའ་ལྷག་པ་
|
5
|
གཟའ་ཕུར་བུ་
|
6
|
གཟའ་པ་སངས་
|
7
|
གཟའ་སྤེན་པ་
|
firstweekofyear: An optional parameter that specifies the starting week of a year.
firstweekofyear value
|
འགྲེལ་པ་
|
0
|
བཏགས་གྲངས་ཀྱི་ཁས་ལེན་ཐང་བེད་སྤྱོད་
|
1
|
གཟའ་འཁོར་དང་པོ་ནི་ཟླ་བ་ 1 ཚེས་གྲངས་ 1གི་རེས་གཟའ་ཚུད་(ཁས་ལེན་)
|
2
|
གཟའ་འཁོར་དང་པོ་ནི་ལོ་དེའི་ཉིན་བཞི་ཡན་ཆོད་ཀྱི་ཉིན་གྲངས་ཀྱི་གཟའ་འཁོར་དང་པོ་ཚུད་ཡོད་
|
3
|
གཟའ་འཁོར་དང་པོ་ནི་ལོ་གསར་པའི་ཉིན་འགའི་གཟའ་འཁོར་དང་པོ་ཁོ་ནར་གཏོགས་
|
Sub example_datepart
MsgBox DatePart("ww", #12/31/2005#)
MsgBox DatePart(date:=#1999-12-30#, interval:="q")
End Sub