CommonDateTime Class | 
Namespace: Omada.OE.Model
public static class CommonDateTime
The CommonDateTime type exposes the following members.
| Name | Description | |
|---|---|---|
| ConvertToDateTime(String) | 
            Parses a string and converts it to a datetime.
              | |
| ConvertToDateTime(String, DateTime) | 
            Parses a string and converts it to a datetime.
              | |
| ConvertToDateTime(String, DateTime, Int32) | 
            Specifically to be used by the DateControl!
              | |
| ConvertToLocalDateTime | 
            Converts input to a DateTime - input must 
            conform to one of the formats specified in GetDateTimeInputParseFormats().
            This is not a universal all-purpose conversion routine!
              | |
| FormatDateTime(DateTime, String, Boolean) | 
            Formats a UTC datetime to string in local representation.
              | |
| FormatDateTime(DateTime, String, Int32, Boolean) | 
            Formats a UTC datetime to string in local representation
              | |
| FormatTimeSpan(TimeSpan, TimeSpanFormat) | ||
| FormatTimeSpan(TimeSpan, TimeSpanFormat, IFormatProvider) | ||
| GetActiveUserStartOfDayUtc | 
            Gets the start of the day in the active users local time zone for the specified DateTime, converted to UTC.
              | |
| GetDateTimeInputDisplayFormats | 
            Returnerer datetime format strings for h.h.v. date-felter, time-felter og datetime-felter.
            Strengene anvendes til at formattere datetimes til visning i html input felter.
              | |
| GetDateTimeInputParseFormats | 
             Returnerer datetime format strings til brug for parsing af en dato.
             Formaterne er i overensstemmelse med de formater, som der valideres for client-side.
             Funktionen returnerer formaterne baseret på rækkefølgen af 
             dag, måned og år i det indbyggede ShortDatePattern.
             Metoden forudsætter at ShortDatePattern altid indeholder en kombination
             af d, m og y tegn (i lower eller uppercase) separeret af ShortDatePattern.DateSeparator.
            
             Følgende formater understøttes - bemærk at rækkefølgen af dag, måned og år
             justeres efter ShortDatePattern.
            
             ddMMyyyy
             dd/MM/yyyy
             dd/M/yyyy
             d/MM/yyyy
             d/M/yyyy
                     
             ddMMyyyy HH:mm
             dd/MM/yyyy HH:mm
             dd/M/yyyy HH:mm
             d/MM/yyyy HH:mm
             d/M/yyyy HH:mm
                     
             ddMMyyyy H:mm
             dd/MM/yyyy H:mm
             dd/M/yyyy H:mm
             d/MM/yyyy H:mm
             d/M/yyyy H:mm
                     
             HH:mm
             H:mm
               | |
| GetLocalDateTime(DateTime) | 
            Be carefull with this routine, it returns a local DateTime which is not legal by convention.
              | |
| GetLocalDateTime(DateTime, Int32) | 
            Converts a utc datetime to a datetime in a specific timezone.
            Be carefull with this routine as it returns a DateTime in non-utc time!
              | |
| GetLocalDateTime(DateTime, TimeZoneInfo) | 
            Converts a utc datetime to a datetime in a specific timezone.
            Be careful with this routine as it returns a DateTime in non-utc time!
              | |
| GetModifierTimeInMinute | ||
| GetTimeModifierUnit | 
            Returns TimeModifierUnit.Days, if modifierValue can be divided by 60*24;
            else returns TimeModifierUnit.Hours, if modifierValue can be divided by 60;
            else returns TimeModifierUnit.Minutes.
              | |
| GetTimeModifierUnitTime | ||
| GetTimeZoneName | 
            @@@ Det set ud til at TimeZoneSource har et hul ved disse tre timezones
            Pacific SA Standard Time     (GMT-04:00) Santiago
            New Zealand Standard Time    (GMT+12:00) Auckland, Wellington
            Fiji Standard Time           (GMT+12:00) Fiji, Kamchatka, Marshall Is.
              | |
| GetTimeZoneOffset | 
            Returns the active users actual offset to UTC.
            For instance: On June 1th a danish user has an offset of -120 minutter
            On Nov. 1th a danish user has an offset of -60 minutter
              | |
| GetUtcDateTime(DateTime) | 
            Be carefull with this routine, it returns a utc DateTime from a local DateTime which is not legal by convention.
              | |
| GetUtcDateTime(DateTime, Int32) | ||
| GetUtcDateTime(DateTime, TimeZoneInfo) | 
            Be carefull with this routine, it returns a UTC DateTime from a local DateTime which is not legal by convention.
              | |
| YYYYMMDDHHMMStrToDate | 
            Converts a string on the format YYYYMMDD HHmm to a datetime in utc time
              | |
| YYYYMMDDStrToDate | ||
| YYYYMMDDStrToDatePlus235959 | 
            Converts a string on the format YYYYMMDD to a datetime in utc time and atts 23 hours  59 minutes and 59 seconds.
            For instance:: The method is called with the string "20061224" by an identity having a utc offset of +2 hours.
            The UTC time them becomes 2006-12-23 22:00:00.
            Then 23 hours, 59 minutes and 59 seconds are added.
            The result is 2006-12-24 21:59:59.
              |