Click or drag to resize
DateTimeHelper Class
Methods to work with the DateTime.
Inheritance Hierarchy

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 10.0.0
Syntax
C#
public class DateTimeHelper : CoreMethods

The DateTimeHelper type exposes the following members.

Constructors
  NameDescription
Public methodDateTimeHelper
Top
Fields
  NameDescription
Public fieldStatic memberMACRO_DATE_TODAY
Macro representing current date.
Public fieldStatic memberMACRO_TIME_NOW
Macro representing current date and time.
Public fieldStatic memberUNIX_TIME_START
Start date/time for the Unix time stamp
Public fieldStatic memberZERO_TIME
Zero time constant.
Top
Properties
  NameDescription
Public propertyStatic memberDefaultIFormatProvider
Gets the default (en-us) IFormatProvider.
Top
Methods
  NameDescription
Public methodStatic memberDateTimeToString
Converts the given DateTime to string value.
Public methodStatic memberGetDayStart
Gets start of the day of specific date.
Public methodStatic memberGetFirstDayOfWeek
Gets the first day of the week.
Public methodStatic memberGetFirstDayOfWeek(String)
Gets the first day of the week.
Public methodStatic memberGetFormattedValidity
Returns validity as formatted string.
Public methodStatic memberGetHourStart
Gets current date without minutes and seconds.
Public methodStatic memberGetMinuteStart
Gets current date without seconds.
Public methodStatic memberGetMonthStart
Gets the first day of the month from specific date.
Public methodStatic memberGetValidityEnum
Returns validity enumeration.
Public methodStatic memberGetValidityString
Returns validity enumeration as string.
Public methodStatic memberGetValidTo
Calculate valid to date and time according to given parameters.
Public methodStatic memberGetWeekOfYear(DateTime)
Gets the week of year number.
Public methodStatic memberGetWeekOfYear(DateTime, String)
Gets the week of year number.
Public methodStatic memberGetWeekStart(DateTime)
Gets the date from the beginning of week.
Public methodStatic memberGetWeekStart(DateTime, String)
Gets the date from the beginning of week.
Public methodStatic memberGetYearStart
Gets the first day of the year from specific date.
Public methodStatic memberIsNowOrToday
Returns true, if the given value is ##NOW## or ##TODAY## macro
Public methodStatic memberIsValidFromTo
Returns true if DateTime "from" is lower than or equal to DateTime "to" or one of them is equal to ZeroTime.
Public methodStatic memberNumberOfWeeks(DateTime, DateTime)
Gets number of weeks in specified time interval.
Public methodStatic memberNumberOfWeeks(DateTime, DateTime, String)
Gets number of weeks in specified time interval.
Top
See Also