System.Globalization.PersianCalendar.ToDateTime Method

Returns a DateTime object that is set to the specified date, time, and era.

Syntax

public override DateTime ToDateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, int era)

Parameters

year
An integer from 1 through 9378 that represents the year.
month
An integer from 1 through 12 that represents the month.
day
An integer from 1 through 31 that represents the day.
hour
An integer from 0 through 23 that represents the hour.
minute
An integer from 0 through 59 that represents the minute.
second
An integer from 0 through 59 that represents the second.
millisecond
An integer from 0 through 999 that represents the millisecond.
era
An integer from 0 through 1 that represents the era.

Returns

A DateTime object that is set to the specified date and time in the current era.

Remarks

The PersianCalendar.ToDateTime(int, int, int, int, int, int, int, int) method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar.

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0