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