MindFusion.Reporting for Silverlight Programmer's Guide
DatePart

Returns the specified component of the specified date.

Syntax

 Copy Code

int DatePart (
    string part,
    DateTime date
)

Parameters

part
A string expression that is the interval of time you want to return. See the Remarks section for possible values.
date
A DateTime value you want to evaluate.

Remarks

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.

See Also

Date & Time Functions
DateAdd Function
DateDiff Function
Month Function
Day Function
Hour Functinon
Minute Function
Second Function