// Returns the DateTimeOffset resulting from adding the given // TimeSpan to this DateTimeOffset. // public DateTimeOffset Add(TimeSpan timeSpan) { return(new DateTimeOffset(ClockDateTime.Add(timeSpan), Offset)); }
// 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)); }
// 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)); }
public DateTimeOffset Subtract(TimeSpan value) { return(new DateTimeOffset(ClockDateTime.Subtract(value), Offset)); }
// 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)); }
// 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)); }
// 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)); }
public DateTimeOffset AddMonths(int months) { return(new DateTimeOffset(ClockDateTime.AddMonths(months), Offset)); }
// 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)); }
// 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)); }
public override int GetHashCode() { return((string.Format("{0} | {1}", StaffId, ClockDateTime.ToString("dd/MM/yyyy HH:mm:ss"))).GetHashCode()); }
public override string ToString() { return(string.Format("{0} - {1} - {2}", StaffId, ClockDateTime.ToString("dd/MM/yyyy HH:mm:ss"), RecordStatus)); }
private DateTimeOffset GetSysDateTimeOffset() { AssertValid(); Contracts.Assert(!IsNA); return(new SysDateTimeOffset(ClockDateTime.GetSysDateTime(), new TimeSpan(0, _offset.RawValue, 0))); }