예제 #1
0
 public ZonedDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
예제 #2
0
파일: Instant.cs 프로젝트: adtyn/nodatime
 public Instant PlusTicks(long ticks) => FromUntrustedDuration(duration + Duration.FromTicks(ticks));
예제 #3
0
 public OffsetDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Instant" /> struct based
 /// on a number of ticks since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.
 /// </summary>
 /// <remarks>This is equivalent to calling the constructor directly, but indicates
 /// intent more explicitly.</remarks>
 /// <returns>An <see cref="Instant"/> at exactly the given number of ticks since the Unix epoch.</returns>
 /// <param name="ticks">Number of ticks since the Unix epoch. May be negative (for instants before the epoch).</param>
 public static Instant FromUnixTimeTicks(long ticks)
 {
     Preconditions.CheckArgumentRange(nameof(ticks), ticks, MinTicks, MaxTicks);
     return(Instant.FromTrustedDuration(Duration.FromTicks(ticks)));
 }
예제 #5
0
 /// <summary>
 /// TO Duration
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public static Duration AsDuration(this Period p) => Duration.FromTicks(p.Ticks);
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Instant" /> struct based
 /// on a number of ticks since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.
 /// </summary>
 /// <remarks>This is equivalent to calling the constructor directly, but indicates
 /// intent more explicitly.</remarks>
 /// <returns>An <see cref="Instant"/> at exactly the given number of ticks since the Unix epoch.</returns>
 /// <param name="ticks">Number of ticks since the Unix epoch. May be negative (for instants before the epoch).</param>
 public static Instant FromTicksSinceUnixEpoch(long ticks)
 {
     Preconditions.CheckArgumentRange(nameof(ticks), ticks, MinTicks, MaxTicks);
     return(new Instant(Duration.FromTicks(ticks)));
 }
예제 #7
0
 public Instant PlusTicks(long ticksToAdd) => new Instant(duration + Duration.FromTicks(ticksToAdd));