当前位置: 首页>>代码示例>>C#>>正文


C# Date.getTime方法代码示例

本文整理汇总了C#中Date.getTime方法的典型用法代码示例。如果您正苦于以下问题:C# Date.getTime方法的具体用法?C# Date.getTime怎么用?C# Date.getTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Date的用法示例。


在下文中一共展示了Date.getTime方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DateRange

 public DateRange(Date lower, Date upper)
   : base((double) lower.getTime(), (double) upper.getTime())
 {
   DateRange dateRange = this;
   this.lowerDate = lower.getTime();
   this.upperDate = upper.getTime();
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:7,代码来源:DateRange.cs

示例2: FixedMillisecond

 public FixedMillisecond(Date time)
 {
   FixedMillisecond fixedMillisecond = this;
   this.time = time.getTime();
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:5,代码来源:FixedMillisecond.cs

示例3: DurationBetween

 /// <summary>
 /// Return the duration between two dates. If either date is null a duration of 0 is returned. 
 /// </summary>
 /// <param name="start">start date</param>
 /// <param name="finish">end date</param>
 /// <returns>duration between the dates (or duration of 0 if either date is null)</returns>
 private static Duration DurationBetween(Date start, Date finish)
 {
     double duration = 0;
     if(start != null && finish != null)
     {
         duration = finish.getTime() - start.getTime();
     }
     return Duration.getInstance(duration / 1000 / 60 / 60 / 24, TimeUnit.DAYS);
 }
开发者ID:theNBS,项目名称:dPOWToMSProject,代码行数:15,代码来源:Convertor.cs

示例4: RelativeDateFormat

 public RelativeDateFormat(Date time)
   : this(time.getTime())
 {
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:4,代码来源:RelativeDateFormat.cs

示例5: format

 public virtual StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition)
 {
   long num1 = date.getTime() - this.baseMillis;
   string str;
   if (num1 < 0L)
   {
     num1 *= -1L;
     str = "-";
   }
   else
     str = this.positivePrefix;
   long num2 = num1;
   long num3 = RelativeDateFormat.MILLISECONDS_IN_ONE_DAY;
   long num4 = -1L;
   long num5 = num3 != num4 ? num2 / num3 : -num2;
   long num6 = num1 - num5 * RelativeDateFormat.MILLISECONDS_IN_ONE_DAY;
   long num7 = num6;
   long num8 = RelativeDateFormat.MILLISECONDS_IN_ONE_HOUR;
   long num9 = -1L;
   long num10 = num8 != num9 ? num7 / num8 : -num7;
   long num11 = num6 - num10 * RelativeDateFormat.MILLISECONDS_IN_ONE_HOUR;
   long num12 = num11 / 60000L;
   double num13 = (double) (num11 - num12 * 60000L) / 1000.0;
   toAppendTo.append(str);
   if (num5 != 0L || this.showZeroDays)
     toAppendTo.append(new StringBuffer().append(this.dayFormatter.format(num5)).append(this.getDaySuffix()).toString());
   if (num10 != 0L || this.showZeroHours)
     toAppendTo.append(new StringBuffer().append(this.hourFormatter.format(num10)).append(this.getHourSuffix()).toString());
   toAppendTo.append(new StringBuffer().append(this.minuteFormatter.format(num12)).append(this.getMinuteSuffix()).toString());
   toAppendTo.append(new StringBuffer().append(this.secondFormatter.format(num13)).append(this.getSecondSuffix()).toString());
   return toAppendTo;
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:32,代码来源:RelativeDateFormat.cs

示例6: FromJavaDate

        /// <summary>
        /// Converts a Java Date value to a DateTime value
        /// </summary>
        /// <param name="javaDate">The Java date</param>
        /// <returns></returns>
        private static DateTime FromJavaDate(Date javaDate)
        {
            if (_configTimeZone == null)
            {
                // Read time zone from market-hours-config
                var symbol = Symbol.Create("*", SecurityType.Forex, Market.FXCM);
                _configTimeZone = MarketHoursDatabase.FromDataFolder().GetDataTimeZone(symbol.ID.Market, symbol, symbol.ID.SecurityType);
            }

            // Convert javaDate to UTC Instant (Epoch)
            var instant = Instant.FromMillisecondsSinceUnixEpoch(javaDate.getTime());

            // Convert to configured TZ then to a .Net DateTime
            return instant.InZone(_configTimeZone).ToDateTimeUnspecified();
        }
开发者ID:AlexCatarino,项目名称:Lean,代码行数:20,代码来源:FxcmBrokerage.Util.cs


注:本文中的Date.getTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。