diff --git a/X10D/src/DateTimeExtensions.cs b/X10D/src/DateTimeExtensions.cs
index fb4874b..0cf8d16 100644
--- a/X10D/src/DateTimeExtensions.cs
+++ b/X10D/src/DateTimeExtensions.cs
@@ -110,43 +110,6 @@
return new DateTime(current.Year, current.Month, current.Day, 12, 0, 0);
}
- ///
- /// Sets the time of the current date with minute precision.
- ///
- /// The current date.
- /// The hour.
- /// The minute.
- public static DateTime SetTime(this DateTime current, int hour, int minute)
- {
- return current.SetTime(hour, minute, 0, 0);
- }
-
- ///
- /// Sets the time of the current date with second precision.
- ///
- /// The current date
- /// The hour.
- /// The minute.
- /// The second.
- ///
- public static DateTime SetTime(this DateTime current, int hour, int minute, int second)
- {
- return current.SetTime(hour, minute, second, 0);
- }
-
- ///
- /// Sets the time of the current date with millisecond precision.
- ///
- /// The current date.
- /// The hour.
- /// The minute.
- /// The second.
- /// The millisecond.
- public static DateTime SetTime(this DateTime current, int hour, int minute, int second, int millisecond)
- {
- return new DateTime(current.Year, current.Month, current.Day, hour, minute, second, millisecond);
- }
-
///
/// Converts the to a Unix timestamp.
///
@@ -156,8 +119,8 @@
/// Returns a Unix timestamp representing the provided .
public static long ToUnixTimeStamp(this DateTime time, bool useMillis = false)
{
- DateTimeOffset offset = time.ToUniversalTime();
- return useMillis ? offset.ToUnixTimeSeconds() : offset.ToUnixTimeMilliseconds();
+ DateTimeOffset offset = time;
+ return useMillis ? offset.ToUnixTimeMilliseconds() : offset.ToUnixTimeSeconds();
}
///
@@ -170,5 +133,42 @@
{
return new DateTime(year, date.Month, date.Day, date.Hour, date.Minute, date.Second, date.Millisecond);
}
+
+ ///
+ /// Sets the time of the current date with minute precision.
+ ///
+ /// The current date.
+ /// The hour.
+ /// The minute.
+ public static DateTime WithTime(this DateTime current, int hour, int minute)
+ {
+ return current.WithTime(hour, minute, 0);
+ }
+
+ ///
+ /// Sets the time of the current date with second precision.
+ ///
+ /// The current date
+ /// The hour.
+ /// The minute.
+ /// The second.
+ ///
+ public static DateTime WithTime(this DateTime current, int hour, int minute, int second)
+ {
+ return current.WithTime(hour, minute, second, 0);
+ }
+
+ ///
+ /// Sets the time of the current date with millisecond precision.
+ ///
+ /// The current date.
+ /// The hour.
+ /// The minute.
+ /// The second.
+ /// The millisecond.
+ public static DateTime WithTime(this DateTime current, int hour, int minute, int second, int millisecond)
+ {
+ return new DateTime(current.Year, current.Month, current.Day, hour, minute, second, millisecond);
+ }
}
}