private void Clear() { dateTimeOffset = default(DateTimeOffset); gYearMonth = null; gYear = null; timespan = default(TimeSpan); UsedType = CogsDateType.None; }
public override string ToString() { switch (UsedType) { case CogsDateType.Date: { return(Date.ToString("u").Split(' ')[0]); } case CogsDateType.DateTime: { return(DateTime.ToString("yyyy-MM-dd\\THH:mm:ss.FFFFFFFK")); } case CogsDateType.Duration: { return(string.Format("P{00}DT{00}H{00}M{00}S", Duration.ToString("%d"), Duration.ToString("%h"), Duration.ToString("%m"), Duration.ToString("%s"))); } case CogsDateType.GYear: { return(GYear.ToString()); } case CogsDateType.GYearMonth: { return(GYearMonth.ToString()); } } return(base.ToString()); }
public CogsDate(GYear item) { GYear = item; UsedType = CogsDateType.GYear; }