示例#1
0
文件: Types.cs 项目: spuddybike/cogs
 private void Clear()
 {
     dateTimeOffset = default(DateTimeOffset);
     gYearMonth     = null;
     gYear          = null;
     timespan       = default(TimeSpan);
     UsedType       = CogsDateType.None;
 }
示例#2
0
文件: Types.cs 项目: spuddybike/cogs
        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());
        }
示例#3
0
文件: Types.cs 项目: spuddybike/cogs
 public CogsDate(GYearMonth item)
 {
     GYearMonth = item;
     UsedType   = CogsDateType.GYearMonth;
 }