示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZonedDateTime"/> struct.
 /// </summary>
 /// <param name="instant">The instant.</param>
 /// <param name="zone">The time zone.</param>
 /// <param name="calendar">The calendar system.</param>
 /// <exception cref="ArgumentNullException"><paramref name="zone"/> or <paramref name="calendar"/> is null.</exception>
 public ZonedDateTime(Instant instant, DateTimeZone zone, CalendarSystem calendar)
 {
     Preconditions.CheckNotNull(zone, "zone");
     Preconditions.CheckNotNull(calendar, "calendar");
     offset        = zone.GetUtcOffset(instant);
     localDateTime = new LocalDateTime(instant.Plus(offset), calendar);
     this.zone     = zone;
 }
示例#2
0
 /// <summary>
 /// Add DateTimeSpan
 /// </summary>
 /// <param name="i"></param>
 /// <param name="ts"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static Instant PlusTimeSpan(this Instant i, DateTimeSpan ts)
 {
     return(i.Plus(ts.AsDuration()));
 }
示例#3
0
 /// <summary>
 /// Add days
 /// </summary>
 /// <param name="i"></param>
 /// <param name="days"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static Instant PlusDays(this Instant i, double days)
 {
     return(i.Plus(days.AsDurationOfDays()));
 }
示例#4
0
 /// <summary>
 /// Add hours
 /// </summary>
 /// <param name="i"></param>
 /// <param name="hours"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static Instant PlusHours(this Instant i, double hours)
 {
     return(i.Plus(hours.AsDurationOfHours()));
 }
示例#5
0
 /// <summary>
 /// Add Minutes
 /// </summary>
 /// <param name="i"></param>
 /// <param name="minutes"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static Instant PlusMinutes(this Instant i, double minutes)
 {
     return(i.Plus(minutes.AsDurationOfMinutes()));
 }
示例#6
0
 /// <summary>
 /// Add seconds
 /// </summary>
 /// <param name="i"></param>
 /// <param name="seconds"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static Instant PlusSeconds(this Instant i, double seconds)
 {
     return(i.Plus(seconds.AsDurationOfSeconds()));
 }
示例#7
0
 /// <summary>
 /// Add milliseconds
 /// </summary>
 /// <param name="i"></param>
 /// <param name="milliseconds"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static Instant PlusMilliseconds(this Instant i, double milliseconds)
 {
     return(i.Plus(milliseconds.AsDurationOfMilliseconds()));
 }