Exemplo n.º 1
0
 // Returns the DateTimeOffset resulting from adding the given
 // TimeSpan to this DateTimeOffset.
 //
 public DateTimeOffset Add(TimeSpan timeSpan)
 {
     return(new DateTimeOffset(ClockDateTime.Add(timeSpan), Offset));
 }
Exemplo n.º 2
0
 // Returns the DateTimeOffset resulting from adding a fractional number of
 // days to this DateTimeOffset. The result is computed by rounding the
 // fractional number of days given by value to the nearest
 // millisecond, and adding that interval to this DateTimeOffset. The
 // value argument is permitted to be negative.
 //
 public DateTimeOffset AddDays(double days)
 {
     return(new DateTimeOffset(ClockDateTime.AddDays(days), Offset));
 }
Exemplo n.º 3
0
 // Returns the DateTimeOffset resulting from adding the given number of
 // years to this DateTimeOffset. The result is computed by incrementing
 // (or decrementing) the year part of this DateTimeOffset by value
 // years. If the month and day of this DateTimeOffset is 2/29, and if the
 // resulting year is not a leap year, the month and day of the resulting
 // DateTimeOffset becomes 2/28. Otherwise, the month, day, and time-of-day
 // parts of the result are the same as those of this DateTimeOffset.
 //
 public DateTimeOffset AddYears(int years)
 {
     return(new DateTimeOffset(ClockDateTime.AddYears(years), Offset));
 }
Exemplo n.º 4
0
 public DateTimeOffset Subtract(TimeSpan value)
 {
     return(new DateTimeOffset(ClockDateTime.Subtract(value), Offset));
 }
Exemplo n.º 5
0
 // Returns the DateTimeOffset resulting from adding a fractional number of
 // seconds to this DateTimeOffset. The result is computed by rounding the
 // fractional number of seconds given by value to the nearest
 // millisecond, and adding that interval to this DateTimeOffset. The
 // value argument is permitted to be negative.
 //
 public DateTimeOffset AddSeconds(double seconds)
 {
     return(new DateTimeOffset(ClockDateTime.AddSeconds(seconds), Offset));
 }
Exemplo n.º 6
0
 // Returns the DateTimeOffset resulting from adding the given number of
 // 100-nanosecond ticks to this DateTimeOffset. The value argument
 // is permitted to be negative.
 //
 public DateTimeOffset AddTicks(long ticks)
 {
     return(new DateTimeOffset(ClockDateTime.AddTicks(ticks), Offset));
 }
Exemplo n.º 7
0
 // Returns the DateTimeOffset resulting from adding a fractional number of
 // minutes to this DateTimeOffset. The result is computed by rounding the
 // fractional number of minutes given by value to the nearest
 // millisecond, and adding that interval to this DateTimeOffset. The
 // value argument is permitted to be negative.
 //
 public DateTimeOffset AddMinutes(double minutes)
 {
     return(new DateTimeOffset(ClockDateTime.AddMinutes(minutes), Offset));
 }
Exemplo n.º 8
0
 public DateTimeOffset AddMonths(int months)
 {
     return(new DateTimeOffset(ClockDateTime.AddMonths(months), Offset));
 }
Exemplo n.º 9
0
 // Returns the DateTimeOffset resulting from the given number of
 // milliseconds to this DateTimeOffset. The result is computed by rounding
 // the number of milliseconds given by value to the nearest integer,
 // and adding that interval to this DateTimeOffset. The value
 // argument is permitted to be negative.
 //
 public DateTimeOffset AddMilliseconds(double milliseconds)
 {
     return(new DateTimeOffset(ClockDateTime.AddMilliseconds(milliseconds), Offset));
 }
Exemplo n.º 10
0
 // Returns the DateTimeOffset resulting from adding a fractional number of
 // hours to this DateTimeOffset. The result is computed by rounding the
 // fractional number of hours given by value to the nearest
 // millisecond, and adding that interval to this DateTimeOffset. The
 // value argument is permitted to be negative.
 //
 public DateTimeOffset AddHours(double hours)
 {
     return(new DateTimeOffset(ClockDateTime.AddHours(hours), Offset));
 }
Exemplo n.º 11
0
 public override int GetHashCode()
 {
     return((string.Format("{0} | {1}", StaffId, ClockDateTime.ToString("dd/MM/yyyy HH:mm:ss"))).GetHashCode());
 }
Exemplo n.º 12
0
 public override string ToString()
 {
     return(string.Format("{0} - {1} - {2}", StaffId, ClockDateTime.ToString("dd/MM/yyyy HH:mm:ss"), RecordStatus));
 }
Exemplo n.º 13
0
 private DateTimeOffset GetSysDateTimeOffset()
 {
     AssertValid();
     Contracts.Assert(!IsNA);
     return(new SysDateTimeOffset(ClockDateTime.GetSysDateTime(), new TimeSpan(0, _offset.RawValue, 0)));
 }