コード例 #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="ZonedDateTime"/> from individual date time component values
 /// </summary>
 /// <param name="year"></param>
 /// <param name="month"></param>
 /// <param name="day"></param>
 /// <param name="hour"></param>
 /// <param name="minute"></param>
 /// <param name="second"></param>
 /// <param name="zone"></param>
 public ZonedDateTime(int year, int month, int day, int hour, int minute, int second, Zone zone)
     : this(year, month, day, hour, minute, second, 0, zone)
 {
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="ZonedDateTime"/> from given <see cref="DateTime"/> value.
 /// </summary>
 /// <param name="dateTime"></param>
 /// <param name="offsetSeconds"></param>
 public ZonedDateTime(DateTime dateTime, int offsetSeconds)
     : this(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second,
            TemporalHelpers.ExtractNanosecondFromTicks(dateTime.Ticks), Zone.Of(offsetSeconds))
 {
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="ZonedDateTime"/> from given <see cref="DateTime"/> value.
 /// </summary>
 /// <param name="dateTime"></param>
 /// <param name="zoneId"></param>
 public ZonedDateTime(DateTime dateTime, string zoneId)
     : this(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second,
            TemporalHelpers.ExtractNanosecondFromTicks(dateTime.Ticks), Zone.Of(zoneId))
 {
 }
コード例 #4
0
 internal ZonedDateTime(IHasDateTimeComponents dateTime, Zone zone)
     : this(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second,
            dateTime.Nanosecond, zone)
 {
 }