Click or drag to resize

GregorianDate Methods

The GregorianDate type exposes the following members.

Methods
  NameDescription
Public methodAddDays
Adds the specified number of days to this date and returns the new date.
Public methodAddHours
Adds the specified number of hours to this date and returns the new date.
Public methodAddMinutes
Adds the specified number of minutes to this date and returns the new date.
Public methodAddSeconds
Adds the specified number of seconds to this date and returns the new date.
Public methodCompareTo(GregorianDate)
Compares this instance with another instance of the same type.
Public methodCompareTo(Object)
Compares this instance with another instance of the same type.
Public methodEquals(GregorianDate)
Indicates whether another instance of this type is exactly equal to this instance.
Public methodEquals(Object)
Indicates whether another object is exactly equal to this instance.
(Overrides ValueTypeEquals(Object).)
Public methodGetHashCode
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIsValid
Indicates whether the date values provided are a valid representation of a date and time.
Public methodStatic memberParse(String)

Converts the specified string representation of a date and time to its GregorianDate equivalent.

Note: GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information. However, this will handle three common ISO8601 formats:

  • the extended format "YYYY-MM-DDThh:mm:ss.sZ"
  • The "day of year" equivalent "YYYY-DDDThh:mm:ss.sZ"
  • The basic format "YYYYMMDDThhmmss.sZ"
Public methodStatic memberParse(String, IFormatProvider)

Converts the specified string representation of a date and time to its GregorianDate equivalent using the specified culture-specific format information.

Note: GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information. However, this will handle three common ISO8601 formats:

  • the extended format "YYYY-MM-DDThh:mm:ss.sZ"
  • The "day of year" equivalent "YYYY-DDDThh:mm:ss.sZ"
  • The basic format "YYYYMMDDThhmmss.sZ"
Public methodStatic memberParseExact(String, String, IFormatProvider)

Converts the specified string representation of a date and time to its GregorianDate equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

Note: GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information.

Public methodStatic memberParseExact(String, String, IFormatProvider)

Converts the specified string representation of a date and time to its GregorianDate equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

Note: GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information.

Public methodRoundSeconds(Int32)
Rounds this instance to the specified number of decimal digits in the seconds, rolling over to minutes, hours, days, etc. as necessary. This instance is assumed to express a time in the CoordinatedUniversalTime (UTC) time standard so the Second will be allowed to go above 60 during a leap second.
Public methodRoundSeconds(Int32, TimeStandard)
Rounds this instance to the specified number of decimal digits in the seconds, rolling over to minutes, hours, days, etc. as necessary. If the specified timeStandard is CoordinatedUniversalTime, (UTC), the seconds will be allowed to go above 60 during a leap second. For any other time standard, the Second will be below 60.
Public methodSubtractDays
Subtracts the specified number of days from this date and returns the new date.
Public methodSubtractHours
Subtracts the specified number of hours from this date and returns the new date.
Public methodSubtractMinutes
Subtracts the specified number of minutes from this date and returns the new date.
Public methodSubtractSeconds
Subtracts the specified number of seconds from this date and returns the new date.
Public methodToDateTime
Convert this GregorianDate to a DateTime. The DateTime will be in UTC.
Public methodToIso8601String
Converts the value of this instance to its equivalent ISO8601 extended string representation, with fractional seconds represented to 15 digits.
Public methodToIso8601String(Iso8601Format)
Converts the value of this instance to its equivalent ISO8601 string representation, with fractional seconds represented to 15 digits.
Public methodToIso8601String(Iso8601Format, Int32)
Converts the value of this instance to its equivalent ISO8601 string representation, with fractional seconds represented to the specified number of digits.
Public methodToJulianDate
Convert this GregorianDate to a JulianDate. The time standard will be CoordinatedUniversalTime (UTC), unless this GregorianDate represents the instant of a leap second, in which case the JulianDate will be in InternationalAtomicTime (TAI).
Public methodToJulianDate(TimeStandard)
Convert this GregorianDate to a JulianDate. The GregorianDate is assumed to specify a time in the specified TimeStandard.
Public methodToLongDateString
Converts the value of this instance to its equivalent long date string representation.
Public methodToLongTimeString
Converts the value of this instance to its equivalent long time string representation.
Public methodToShortDateString
Converts the value of this instance to its equivalent short date string representation.
Public methodToShortTimeString
Converts the value of this instance to its equivalent short time string representation.
Public methodToString
Converts the value of this instance to its equivalent string representation.
(Overrides ValueTypeToString.)
Public methodToString(IFormatProvider)
Converts the value of this instance to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String)
Converts the value of this instance to its equivalent string representation using the specified format.
Public methodToString(String, IFormatProvider)
Converts the value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Public methodStatic memberTryParse(String, GregorianDate)

Converts the specified string representation of a date and time to its GregorianDate equivalent.

Note: GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information. However, this method handles three common ISO8601 formats:

  • the extended format "YYYY-MM-DDThh:mm:ss.sZ"
  • The "day of year" equivalent "YYYY-DDDThh:mm:ss.sZ"
  • The basic format "YYYYMMDDThhmmss.sZ"
Public methodStatic memberTryParse(String, IFormatProvider, GregorianDate)

Converts the specified string representation of a date and time to its GregorianDate equivalent using the specified culture-specific format information.

Note: GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information. However, this method handles three common ISO8601 formats:

  • the extended format "YYYY-MM-DDThh:mm:ss.sZ"
  • The "day of year" equivalent "YYYY-DDDThh:mm:ss.sZ"
  • The basic format "YYYYMMDDThhmmss.sZ"
Top
See Also