Click or drag to resize

CommonDateTime Methods

The CommonDateTime type exposes the following members.

Methods
  NameDescription
Public methodStatic memberConvertToDateTime(String)
Parses a string and converts it to a datetime.
Public methodStatic memberConvertToDateTime(String, DateTime)
Parses a string and converts it to a datetime.
Public methodStatic memberConvertToDateTime(String, DateTime, Int32)
Specifically to be used by the DateControl!
Public methodStatic memberConvertToLocalDateTime
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!
Public methodStatic memberFormatDateTime(DateTime, String, Boolean)
Formats a UTC datetime to string in local representation.
Public methodStatic memberFormatDateTime(DateTime, String, Int32, Boolean)
Formats a UTC datetime to string in local representation
Public methodStatic memberFormatTimeSpan(TimeSpan, TimeSpanFormat)
Public methodStatic memberFormatTimeSpan(TimeSpan, TimeSpanFormat, IFormatProvider)
Public methodStatic memberGetActiveUserStartOfDayUtc
Gets the start of the day in the active users local time zone for the specified DateTime, converted to UTC.
Public methodStatic memberGetDateTimeInputDisplayFormats
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.
Public methodStatic memberGetDateTimeInputParseFormats
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
Public methodStatic memberGetLocalDateTime(DateTime)
Be carefull with this routine, it returns a local DateTime which is not legal by convention.
Public methodStatic memberGetLocalDateTime(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!
Public methodStatic memberGetLocalDateTime(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!
Public methodStatic memberGetModifierTimeInMinute
Public methodStatic memberGetTimeModifierUnit
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.
Public methodStatic memberGetTimeModifierUnitTime
Public methodStatic memberGetTimeZoneName
@@@ 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.
Public methodStatic memberGetTimeZoneOffset
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
Public methodStatic memberGetUtcDateTime(DateTime)
Be carefull with this routine, it returns a utc DateTime from a local DateTime which is not legal by convention.
Public methodStatic memberGetUtcDateTime(DateTime, Int32)
Public methodStatic memberGetUtcDateTime(DateTime, TimeZoneInfo)
Be carefull with this routine, it returns a UTC DateTime from a local DateTime which is not legal by convention.
Public methodStatic memberYYYYMMDDHHMMStrToDate
Converts a string on the format YYYYMMDD HHmm to a datetime in utc time
Public methodStatic memberYYYYMMDDStrToDate
Public methodStatic memberYYYYMMDDStrToDatePlus235959
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.
Top
See Also