Esempio n. 1
0
 private void Clear()
 {
     dateTimeOffset = default(DateTimeOffset);
     gYearMonth     = null;
     gYear          = null;
     timespan       = default(TimeSpan);
     UsedType       = CogsDateType.None;
 }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
 public CogsDate(GYearMonth item)
 {
     GYearMonth = item;
     UsedType   = CogsDateType.GYearMonth;
 }