Date Partinterval date[firstdayofweek[ firstweekofyear

This function returns the specified part of a given date. The interval argument is the desired format in which the part of the date will be returned (see Table 13, earlier in this reference, for its values), and date is the date you are examining. The optional arguments firstdayofweek and firstdayofmonth are the same as for the DateDiff() function. On October 23, 2001, the following WriteLine statements would produce results like those shown in bold:

Dim Day1 As DateTime day1 = Now()

Conso1e.WriteLine(DatePart( 2001

Conso1e.WriteLine(DatePart( 3

Conso1e.WriteLine(DatePart( 10

Conso1e.WriteLine(DatePart( 23

Conso1e.WriteLine(DatePart( 3

Conso1e.WriteLine(DatePart( 43

Conso1e.WriteLine(DatePart( 15

Conso1e.WriteLine(DatePart( 3

Conso1e.WriteLine(DatePart( 30

yyyy", dayl)) q", dayl)) m", dayl)) d", dayl)) w", dayl)) ww", dayl)) h", dayl)) n", dayl)) s", dayl))

0 0

Post a comment