C# 클래스 GSF.DateTimeExtensions

Defines extension functions related to Date/Time manipulation.
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf

공개 메소드들

메소드 설명
AbbreviatedMonthName ( this timestamp ) : string

Gets the abbreviated month name for month of the timestamp.

AbbreviatedWeekdayName ( this timestamp ) : string

Gets the abbreviated weekday name for weekday of the timestamp.

BaselinedTimestamp ( this timestamp, BaselineTimeInterval interval ) : System.DateTime

Creates a baselined timestamp which begins at the specified time interval.

Baselining to the BaselineTimeInterval.Second would return the DateTime value starting at zero milliseconds.
Baselining to the BaselineTimeInterval.Minute would return the DateTime value starting at zero seconds and milliseconds.
Baselining to the BaselineTimeInterval.Hour would return the DateTime value starting at zero minutes, seconds and milliseconds.
Baselining to the BaselineTimeInterval.Day would return the DateTime value starting at zero hours, minutes, seconds and milliseconds.
Baselining to the BaselineTimeInterval.Month would return the DateTime value starting at day one, zero hours, minutes, seconds and milliseconds.
Baselining to the BaselineTimeInterval.Year would return the DateTime value starting at month one, day one, zero hours, minutes, seconds and milliseconds.

DistanceBeyondSecond ( this timestamp ) : Ticks

Gets the distance, in Ticks, beyond the top of the timestamp second.

LocalTimeIsValid ( this localTime, double lagTime, double leadTime ) : bool

Determines if the specified local time is valid, by comparing it to the system clock.

Time is considered valid if it exists within the specified lag time/lead time range of current time.

Note that lag time and lead time must be greater than zero, but can be set to sub-second intervals.

LocalTimeTo ( this timestamp, TimeZoneInfo destinationTimeZone ) : System.DateTime

Converts given local time to time in specified time zone.

LocalTimeTo ( this timestamp, string destinationTimeZoneStandardName ) : System.DateTime

Converts given local time to time in specified time zone.

LocalTimeToCentralTime ( this timestamp ) : System.DateTime

Converts given local time to Central time.

LocalTimeToEasternTime ( this timestamp ) : System.DateTime

Converts given local time to Eastern time.

LocalTimeToMountainTime ( this timestamp ) : System.DateTime

Converts given local time to Mountain time.

LocalTimeToPacificTime ( this timestamp ) : System.DateTime

Converts given local time to Pacific time.

LocalTimeToUniversalTime ( this timestamp ) : System.DateTime

Converts given local time to Universally Coordinated Time (a.k.a., Greenwich Meridian Time).

This function is only provided for the sake of completeness. All it does is call the "ToUniversalTime" property on the given timestamp.

MonthName ( this timestamp ) : string

Gets the full month name for month of the timestamp.

ShortWeekdayName ( this timestamp ) : string

Gets the shortest weekday name for weekday of the timestamp.

TimeIsValid ( this testTime, System.DateTime currentTime, double lagTime, double leadTime ) : bool

Determines if time is valid, by comparing it to the specified current time.

Time is considered valid if it exists within the specified lag time/lead time range of current time.

Note that lag time and lead time must be greater than zero, but can be set to sub-second intervals.

TimeZoneToTimeZone ( this timestamp, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone ) : System.DateTime

Converts given timestamp from one time zone to another.

TimeZoneToTimeZone ( this timestamp, string sourceTimeZoneStandardName, string destinationTimeZoneStandardName ) : System.DateTime

Converts given timestamp from one time zone to another using standard names for time zones.

UniversalTimeTo ( this universalTimestamp, TimeZoneInfo destinationTimeZone ) : System.DateTime

Converts the specified Universally Coordinated Time timestamp to timestamp in specified time zone.

UniversalTimeTo ( this universalTimestamp, string destinationTimeZoneStandardName ) : System.DateTime

Converts the specified Universally Coordinated Time timestamp to timestamp in specified time zone.

UniversalTimeToCentralTime ( this universalTimestamp ) : System.DateTime

Converts the specified Universally Coordinated Time timestamp to Central time timestamp.

UniversalTimeToEasternTime ( this universalTimestamp ) : System.DateTime

Converts the specified Universally Coordinated Time timestamp to Eastern time timestamp.

UniversalTimeToMountainTime ( this universalTimestamp ) : System.DateTime

Converts the specified Universally Coordinated Time timestamp to Mountain time timestamp.

UniversalTimeToPacificTime ( this universalTimestamp ) : System.DateTime

Converts the specified Universally Coordinated Time timestamp to Pacific time timestamp.

UtcTimeIsValid ( this utcTime, double lagTime, double leadTime ) : bool

Determines if the specified UTC time is valid, by comparing it to the system clock.

Time is considered valid if it exists within the specified lag time/lead time range of current time.

Note that lag time and lead time must be greater than zero, but can be set to sub-second intervals.

WeekdayName ( this timestamp ) : string

Gets the full weekday name for weekday of the timestamp.

메소드 상세

AbbreviatedMonthName() 공개 정적인 메소드

Gets the abbreviated month name for month of the timestamp.
public static AbbreviatedMonthName ( this timestamp ) : string
timestamp this Timestamp from which month name is extracted.
리턴 string

AbbreviatedWeekdayName() 공개 정적인 메소드

Gets the abbreviated weekday name for weekday of the timestamp.
public static AbbreviatedWeekdayName ( this timestamp ) : string
timestamp this Timestamp from which weekday name is extracted.
리턴 string

BaselinedTimestamp() 공개 정적인 메소드

Creates a baselined timestamp which begins at the specified time interval.
Baselining to the BaselineTimeInterval.Second would return the DateTime value starting at zero milliseconds.
Baselining to the BaselineTimeInterval.Minute would return the DateTime value starting at zero seconds and milliseconds.
Baselining to the BaselineTimeInterval.Hour would return the DateTime value starting at zero minutes, seconds and milliseconds.
Baselining to the BaselineTimeInterval.Day would return the DateTime value starting at zero hours, minutes, seconds and milliseconds.
Baselining to the BaselineTimeInterval.Month would return the DateTime value starting at day one, zero hours, minutes, seconds and milliseconds.
Baselining to the BaselineTimeInterval.Year would return the DateTime value starting at month one, day one, zero hours, minutes, seconds and milliseconds.
public static BaselinedTimestamp ( this timestamp, BaselineTimeInterval interval ) : System.DateTime
timestamp this Timestamp to baseline.
interval BaselineTimeInterval /// to which should be baselined. ///
리턴 System.DateTime

DistanceBeyondSecond() 공개 정적인 메소드

Gets the distance, in Ticks, beyond the top of the timestamp second.
public static DistanceBeyondSecond ( this timestamp ) : Ticks
timestamp this Timestamp to evaluate.
리턴 Ticks

LocalTimeIsValid() 공개 정적인 메소드

Determines if the specified local time is valid, by comparing it to the system clock.

Time is considered valid if it exists within the specified lag time/lead time range of current time.

Note that lag time and lead time must be greater than zero, but can be set to sub-second intervals.

LagTime and LeadTime must be greater than zero, but can /// be less than one.
public static LocalTimeIsValid ( this localTime, double lagTime, double leadTime ) : bool
localTime this Time to test for validity.
lagTime double The allowed lag time, in seconds, before assuming time is too old to be valid.
leadTime double The allowed lead time, in seconds, before assuming time is too advanced to be /// valid.
리턴 bool

LocalTimeTo() 공개 정적인 메소드

Converts given local time to time in specified time zone.
public static LocalTimeTo ( this timestamp, TimeZoneInfo destinationTimeZone ) : System.DateTime
timestamp this Timestamp in local time to be converted to time in specified time zone.
destinationTimeZone System.TimeZoneInfo Desired end time zone for given timestamp.
리턴 System.DateTime

LocalTimeTo() 공개 정적인 메소드

Converts given local time to time in specified time zone.
public static LocalTimeTo ( this timestamp, string destinationTimeZoneStandardName ) : System.DateTime
timestamp this Timestamp in local time to be converted to time in specified time zone.
destinationTimeZoneStandardName string Standard name of desired end time zone for given /// timestamp.
리턴 System.DateTime

LocalTimeToCentralTime() 공개 정적인 메소드

Converts given local time to Central time.
public static LocalTimeToCentralTime ( this timestamp ) : System.DateTime
timestamp this Timestamp in local time to be converted to Central time.
리턴 System.DateTime

LocalTimeToEasternTime() 공개 정적인 메소드

Converts given local time to Eastern time.
public static LocalTimeToEasternTime ( this timestamp ) : System.DateTime
timestamp this Timestamp in local time to be converted to Eastern time.
리턴 System.DateTime

LocalTimeToMountainTime() 공개 정적인 메소드

Converts given local time to Mountain time.
public static LocalTimeToMountainTime ( this timestamp ) : System.DateTime
timestamp this Timestamp in local time to be converted to Mountain time.
리턴 System.DateTime

LocalTimeToPacificTime() 공개 정적인 메소드

Converts given local time to Pacific time.
public static LocalTimeToPacificTime ( this timestamp ) : System.DateTime
timestamp this Timestamp in local time to be converted to Pacific time.
리턴 System.DateTime

LocalTimeToUniversalTime() 공개 정적인 메소드

Converts given local time to Universally Coordinated Time (a.k.a., Greenwich Meridian Time).
This function is only provided for the sake of completeness. All it does is call the "ToUniversalTime" property on the given timestamp.
public static LocalTimeToUniversalTime ( this timestamp ) : System.DateTime
timestamp this Timestamp in local time to be converted to Universal time.
리턴 System.DateTime

MonthName() 공개 정적인 메소드

Gets the full month name for month of the timestamp.
public static MonthName ( this timestamp ) : string
timestamp this Timestamp from which month name is extracted.
리턴 string

ShortWeekdayName() 공개 정적인 메소드

Gets the shortest weekday name for weekday of the timestamp.
public static ShortWeekdayName ( this timestamp ) : string
timestamp this Timestamp from which weekday name is extracted.
리턴 string

TimeIsValid() 공개 정적인 메소드

Determines if time is valid, by comparing it to the specified current time.

Time is considered valid if it exists within the specified lag time/lead time range of current time.

Note that lag time and lead time must be greater than zero, but can be set to sub-second intervals.

LagTime and LeadTime must be greater than zero, but can /// be less than one.
public static TimeIsValid ( this testTime, System.DateTime currentTime, double lagTime, double leadTime ) : bool
testTime this Time to test for validity.
currentTime System.DateTime Specified current time (e.g., could be Date.Now or Date.UtcNow).
lagTime double The allowed lag time, in seconds, before assuming time is too old to be valid.
leadTime double The allowed lead time, in seconds, before assuming time is too advanced to be /// valid.
리턴 bool

TimeZoneToTimeZone() 공개 정적인 메소드

Converts given timestamp from one time zone to another.
public static TimeZoneToTimeZone ( this timestamp, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone ) : System.DateTime
timestamp this Timestamp in source time zone to be converted to time in destination time /// zone.
sourceTimeZone System.TimeZoneInfo Time zone for given source timestamp.
destinationTimeZone System.TimeZoneInfo Desired end time zone for given source timestamp.
리턴 System.DateTime

TimeZoneToTimeZone() 공개 정적인 메소드

Converts given timestamp from one time zone to another using standard names for time zones.
public static TimeZoneToTimeZone ( this timestamp, string sourceTimeZoneStandardName, string destinationTimeZoneStandardName ) : System.DateTime
timestamp this Timestamp in source time zone to be converted to time in destination time zone.
sourceTimeZoneStandardName string Standard name of time zone for given source timestamp.
destinationTimeZoneStandardName string Standard name of desired end time zone for given source /// timestamp.
리턴 System.DateTime

UniversalTimeTo() 공개 정적인 메소드

Converts the specified Universally Coordinated Time timestamp to timestamp in specified time zone.
public static UniversalTimeTo ( this universalTimestamp, TimeZoneInfo destinationTimeZone ) : System.DateTime
universalTimestamp this The Universally Coordinated Time timestamp that is to be converted.
destinationTimeZone System.TimeZoneInfo The time zone to which the Universally Coordinated Time timestamp /// is to be converted to.
리턴 System.DateTime

UniversalTimeTo() 공개 정적인 메소드

Converts the specified Universally Coordinated Time timestamp to timestamp in specified time zone.
public static UniversalTimeTo ( this universalTimestamp, string destinationTimeZoneStandardName ) : System.DateTime
universalTimestamp this The Universally Coordinated Time timestamp that is to be converted.
destinationTimeZoneStandardName string The time zone standard name to which the Universally /// Coordinated Time timestamp is to be converted to.
리턴 System.DateTime

UniversalTimeToCentralTime() 공개 정적인 메소드

Converts the specified Universally Coordinated Time timestamp to Central time timestamp.
public static UniversalTimeToCentralTime ( this universalTimestamp ) : System.DateTime
universalTimestamp this The Universally Coordinated Time timestamp that is to be converted.
리턴 System.DateTime

UniversalTimeToEasternTime() 공개 정적인 메소드

Converts the specified Universally Coordinated Time timestamp to Eastern time timestamp.
public static UniversalTimeToEasternTime ( this universalTimestamp ) : System.DateTime
universalTimestamp this The Universally Coordinated Time timestamp that is to be converted.
리턴 System.DateTime

UniversalTimeToMountainTime() 공개 정적인 메소드

Converts the specified Universally Coordinated Time timestamp to Mountain time timestamp.
public static UniversalTimeToMountainTime ( this universalTimestamp ) : System.DateTime
universalTimestamp this The Universally Coordinated Time timestamp that is to be converted.
리턴 System.DateTime

UniversalTimeToPacificTime() 공개 정적인 메소드

Converts the specified Universally Coordinated Time timestamp to Pacific time timestamp.
public static UniversalTimeToPacificTime ( this universalTimestamp ) : System.DateTime
universalTimestamp this The Universally Coordinated Time timestamp that is to be converted.
리턴 System.DateTime

UtcTimeIsValid() 공개 정적인 메소드

Determines if the specified UTC time is valid, by comparing it to the system clock.

Time is considered valid if it exists within the specified lag time/lead time range of current time.

Note that lag time and lead time must be greater than zero, but can be set to sub-second intervals.

LagTime and LeadTime must be greater than zero, but can /// be less than one.
public static UtcTimeIsValid ( this utcTime, double lagTime, double leadTime ) : bool
utcTime this UTC time to test for validity.
lagTime double The allowed lag time, in seconds, before assuming time is too old to be valid.
leadTime double The allowed lead time, in seconds, before assuming time is too advanced to be /// valid.
리턴 bool

WeekdayName() 공개 정적인 메소드

Gets the full weekday name for weekday of the timestamp.
public static WeekdayName ( this timestamp ) : string
timestamp this Timestamp from which weekday name is extracted.
리턴 string