Time Utilities class provides date and time related routines.
Westwind.Utilities.TimeUtils
public static class TimeUtils : object
Class Members
Member | Description | |
---|---|---|
MIN_DATE_VALUE |
||
DateTimeFromDateAndTime |
Creates a DateTime value from date and time input values public static DateTime DateTimeFromDateAndTime(string Date, string Time) public static DateTime DateTimeFromDateAndTime(DateTime Date, string Time) |
|
FractionalHoursToString |
Converts a fractional hour value like 1.25 to 1:15 hours:minutes format public static string FractionalHoursToString(decimal hours, string format) public static string FractionalHoursToString(decimal hours) |
|
FriendlyDateString |
Displays a date in friendly format. public static string FriendlyDateString(DateTime Date, bool ShowTime) |
|
FriendlyElapsedTimeString |
Displays a number of milliseconds as friendly seconds, hours, minutes Pass -1 to get a blank date. public static string FriendlyElapsedTimeString(int milliSeconds) public static string FriendlyElapsedTimeString(TimeSpan elapsed) |
|
MimeDateTime |
Converts the passed date time value to Mime formatted time string public static string MimeDateTime(DateTime Time) |
|
RoundDateToMinuteInterval |
Rounds an hours value to a minute interval 0 means no rounding public static decimal RoundDateToMinuteInterval(decimal hours, int minuteInterval, RoundingDirection direction) public static DateTime RoundDateToMinuteInterval(DateTime time, int minuteInterval, RoundingDirection direction) |
|
ShortDateString |
Returns a short date time string public static string ShortDateString(DateTime date, bool showTime) public static string ShortDateString(DateTime? date, bool ShowTime) |
|
ToTimeZoneTime |
Returns TimeZone adjusted time for a given from a Utc or local time. Date is first converted to UTC then adjusted. public static DateTime ToTimeZoneTime(DateTime time, string timeZoneId) public static DateTime ToTimeZoneTime(DateTime time, TimeZoneInfo tzi) |
|
Truncate |
Truncates a DateTime value to the nearest partial value. public static DateTime Truncate(DateTime date, DateTimeResolution resolution) |
Requirements
Namespace: Westwind.UtilitiesAssembly: westwind.utilities.dll
© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic