PHP Code:
public DateTime(long ticks);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to a specified
// number of ticks and to Coordinated Universal Time (UTC) or local time.
//
// Parameters:
// ticks:
// A date and time expressed in 100-nanosecond units.
//
// kind:
// One of the System.DateTimeKind values that indicates whether ticks specifies
// a local time, Coordinated Universal Time (UTC), or neither.
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// ticks is less than System.DateTime.MinValue or greater than System.DateTime.MaxValue.
//
// System.ArgumentException:
// kind is not one of the System.DateTimeKind values.
public DateTime(long ticks, DateTimeKind kind);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, and day.
//
// Parameters:
// month:
// The month (1 through 12).
//
// day:
// The day (1 through the number of days in month).
//
// year:
// The year (1 through 9999).
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// year is less than 1 or greater than 9999.-or- month is less than 1 or greater
// than 12.-or- day is less than 1 or greater than the number of days in month.
//
// System.ArgumentException:
// The specified parameters evaluate to less than System.DateTime.MinValue or
// more than System.DateTime.MaxValue.
public DateTime(int year, int month, int day);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, and day for the specified calendar.
//
// Parameters:
// calendar:
// The System.Globalization.Calendar that applies to this System.DateTime.
//
// month:
// The month (1 through the number of months in calendar).
//
// day:
// The day (1 through the number of days in month).
//
// year:
// The year (1 through the number of years in calendar).
//
// Exceptions:
// System.ArgumentException:
// Specified parameters evaluate to less than System.DateTime.MinValue or more
// than System.DateTime.MaxValue.
//
// System.ArgumentOutOfRangeException:
// year is not in the range supported by calendar.-or- month is less than 1
// or greater than the number of months in calendar.-or- day is less than 1
// or greater than the number of days in month.
//
// System.ArgumentNullException:
// calendar is null.
public DateTime(int year, int month, int day, Calendar calendar);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, day, hour, minute, and second.
//
// Parameters:
// month:
// The month (1 through 12).
//
// day:
// The day (1 through the number of days in month).
//
// minute:
// The minutes (0 through 59).
//
// year:
// The year (1 through 9999).
//
// hour:
// The hours (0 through 23).
//
// second:
// The seconds (0 through 59).
//
// Exceptions:
// System.ArgumentException:
// Specified parameters evaluate to less than System.DateTime.MinValue or more
// than System.DateTime.MaxValue.
//
// System.ArgumentOutOfRangeException:
// year is less than 1 or greater than 9999. -or- month is less than 1 or greater
// than 12. -or- day is less than 1 or greater than the number of days in month.-or-
// hour is less than 0 or greater than 23. -or- minute is less than 0 or greater
// than 59. -or- second is less than 0 or greater than 59.
public DateTime(int year, int month, int day, int hour, int minute, int second);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, day, hour, minute, and second for the specified calendar.
//
// Parameters:
// calendar:
// The System.Globalization.Calendar that applies to this System.DateTime.
//
// month:
// The month (1 through the number of months in calendar).
//
// day:
// The day (1 through the number of days in month).
//
// minute:
// The minutes (0 through 59).
//
// year:
// The year (1 through the number of years in calendar).
//
// hour:
// The hours (0 through 23).
//
// second:
// The seconds (0 through 59).
//
// Exceptions:
// System.ArgumentException:
// Specified parameters evaluate to less than System.DateTime.MinValue or more
// than System.DateTime.MaxValue.
//
// System.ArgumentNullException:
// calendar is null.
//
// System.ArgumentOutOfRangeException:
// year is not in the range supported by calendar.-or- month is less than 1
// or greater than the number of months in calendar.-or- day is less than 1
// or greater than the number of days in month.-or- hour is less than 0 or greater
// than 23 -or- minute is less than 0 or greater than 59. -or- second is less
// than 0 or greater than 59.
public DateTime(int year, int month, int day, int hour, int minute, int second, Calendar calendar);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, day, hour, minute, second, and Coordinated Universal Time (UTC)
// or local time.
//
// Parameters:
// month:
// The month (1 through 12).
//
// day:
// The day (1 through the number of days in month).
//
// minute:
// The minutes (0 through 59).
//
// year:
// The year (1 through 9999).
//
// hour:
// The hours (0 through 23).
//
// kind:
// One of the System.DateTimeKind values that indicates whether year, month,
// day, hour, minute and second specify a local time, Coordinated Universal
// Time (UTC), or neither.
//
// second:
// The seconds (0 through 59).
//
// Exceptions:
// System.ArgumentException:
// The specified time parameters evaluate to less than System.DateTime.MinValue
// or more than System.DateTime.MaxValue. -or-kind is not one of the System.DateTimeKind
// values.
//
// System.ArgumentOutOfRangeException:
// year is less than 1 or greater than 9999. -or- month is less than 1 or greater
// than 12. -or- day is less than 1 or greater than the number of days in month.-or-
// hour is less than 0 or greater than 23. -or- minute is less than 0 or greater
// than 59. -or- second is less than 0 or greater than 59.
public DateTime(int year, int month, int day, int hour, int minute, int second, DateTimeKind kind);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, day, hour, minute, second, and millisecond.
//
// Parameters:
// month:
// The month (1 through 12).
//
// millisecond:
// The milliseconds (0 through 999).
//
// day:
// The day (1 through the number of days in month).
//
// minute:
// The minutes (0 through 59).
//
// year:
// The year (1 through 9999).
//
// hour:
// The hours (0 through 23).
//
// second:
// The seconds (0 through 59).
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// year is less than 1 or greater than 9999.-or- month is less than 1 or greater
// than 12.-or- day is less than 1 or greater than the number of days in month.-or-
// hour is less than 0 or greater than 23.-or- minute is less than 0 or greater
// than 59.-or- second is less than 0 or greater than 59.-or- millisecond is
// less than 0 or greater than 999.
//
// System.ArgumentException:
// Specified parameters evaluate to less than System.DateTime.MinValue or more
// than System.DateTime.MaxValue.
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, day, hour, minute, second, and millisecond for the specified
// calendar.
//
// Parameters:
// calendar:
// The System.Globalization.Calendar that applies to this System.DateTime.
//
// month:
// The month (1 through the number of months in calendar).
//
// millisecond:
// The milliseconds (0 through 999).
//
// day:
// The day (1 through the number of days in month).
//
// minute:
// The minutes (0 through 59).
//
// year:
// The year (1 through the number of years in calendar).
//
// hour:
// The hours (0 through 23).
//
// second:
// The seconds (0 through 59).
//
// Exceptions:
// System.ArgumentException:
// Specified parameters evaluate to less than System.DateTime.MinValue or more
// than System.DateTime.MaxValue.
//
// System.ArgumentNullException:
// calendar is null.
//
// System.ArgumentOutOfRangeException:
// year is not in the range supported by calendar.-or- month is less than 1
// or greater than the number of months in calendar.-or- day is less than 1
// or greater than the number of days in month.-or- hour is less than 0 or greater
// than 23.-or- minute is less than 0 or greater than 59.-or- second is less
// than 0 or greater than 59.-or- millisecond is less than 0 or greater than
// 999.
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, day, hour, minute, second, millisecond, and Coordinated Universal
// Time (UTC) or local time.
//
// Parameters:
// month:
// The month (1 through 12).
//
// millisecond:
// The milliseconds (0 through 999).
//
// day:
// The day (1 through the number of days in month).
//
// minute:
// The minutes (0 through 59).
//
// year:
// The year (1 through 9999).
//
// hour:
// The hours (0 through 23).
//
// kind:
// One of the System.DateTimeKind values that indicates whether year, month,
// day, hour, minute, second, and millisecond specify a local time, Coordinated
// Universal Time (UTC), or neither.
//
// second:
// The seconds (0 through 59).
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// year is less than 1 or greater than 9999.-or- month is less than 1 or greater
// than 12.-or- day is less than 1 or greater than the number of days in month.-or-
// hour is less than 0 or greater than 23.-or- minute is less than 0 or greater
// than 59.-or- second is less than 0 or greater than 59.-or- millisecond is
// less than 0 or greater than 999.
//
// System.ArgumentException:
// The specified time parameters evaluate to less than System.DateTime.MinValue
// or more than System.DateTime.MaxValue. -or-kind is not one of the System.DateTimeKind
// values.
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, DateTimeKind kind);
//
// Summary:
// Initializes a new instance of the System.DateTime structure to the specified
// year, month, day, hour, minute, second, millisecond, and Coordinated Universal
// Time (UTC) or local time for the specified calendar.
//
// Parameters:
// calendar:
// The System.Globalization.Calendar that applies to this System.DateTime.
//
// month:
// The month (1 through the number of months in calendar).
//
// millisecond:
// The milliseconds (0 through 999).
//
// day:
// The day (1 through the number of days in month).
//
// minute:
// The minutes (0 through 59).
//
// year:
// The year (1 through the number of years in calendar).
//
// hour:
// The hours (0 through 23).
//
// kind:
// One of the System.DateTimeKind values that indicates whether year, month,
// day, hour, minute, second, and millisecond specify a local time, Coordinated
// Universal Time (UTC), or neither.
//
// second:
// The seconds (0 through 59).
//
// Exceptions:
// System.ArgumentException:
// The specified time parameters evaluate to less than System.DateTime.MinValue
// or more than System.DateTime.MaxValue. -or-kind is not one of the System.DateTimeKind
// values.
//
// System.ArgumentNullException:
// calendar is null.
//
// System.ArgumentOutOfRangeException:
// year is not in the range supported by calendar.-or- month is less than 1
// or greater than the number of months in calendar.-or- day is less than 1
// or greater than the number of days in month.-or- hour is less than 0 or greater
// than 23.-or- minute is less than 0 or greater than 59.-or- second is less
// than 0 or greater than 59.-or- millisecond is less than 0 or greater than
// 999.
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, DateTimeKind kind);
Ví dụ: chuyển 1 kiểu string -> DateTime
Bookmarks