Class DateHelper
- Namespace
- Dynamicweb.Core.Helpers
- Assembly
- Dynamicweb.Core.dll
Class Dates contains date formatting strings and methods.
- Inheritance
-
Date
Helper
- Inherited Members
Examples
using Dynamicweb.Core.Helpers;
using System;
using System.Globalization;
namespace Dynamicweb.Core.Examples;
public static class DateHelperSample
{
public static void FormatStringSample()
{
string dateFormatting = DateHelper.DateOnlyFormatStringSortable; //"yyyy-MM-dd"
DateTime someDate = new DateTime(2016, 09, 05,15, 46, 0);
string formattedDate = someDate.ToString(dateFormatting, CultureInfo.InvariantCulture); //"2016-09-05"
}
}
Fields
DateFormatString
Returns a string for String.Format: "ddd, dd MMM yyyy HH':'mm"
Field Value
DateFormatStringDayAndMonth
Returns a string for String.Format: "dd. MMM"
Field Value
DateFormatStringFull
Returns a string for String.Format: "ddd, dd MMM yyyy HH':'mm':'ss"
Field Value
DateFormatStringShort
Returns a string for String.Format: "dd MMM yyyy HH':'mm"
Field Value
DateFormatStringSortable
Returns a string for String.Format: "{0:s}" resulting in SQL and sort safe date strings, i.e. "2008-03-31T16:05:07"
Field Value
DateOnlyFormatString
Returns a string for String.Format: "ddd, dd MMM yyyy"
Field Value
DateOnlyFormatStringMedium
Returns a string for String.Format: "ddd, dd MMM yyyy"
Field Value
DateOnlyFormatStringShort
Returns a string for String.Format: "dd-mm-yyyy"
Field Value
DateOnlyFormatStringSortable
Returns a string for String.Format: "yyyy-M-dd" resulting in SQL and sort safe date strings, i.e. "2008-3-31""
Field Value
IsoDateFormatString
Returns a string for String.Format: "yyyy-MM-ddTHH:mm"
Field Value
TimeOnlyFormatStringFull
Returns a string for String.Format: "hh:mm:ss"
Field Value
Methods
MaxDate()
Returns the maximum DateTime value accepted by Dynamicweb (2999/12/31 23:59:59).
Returns
MinDate()
Returns the minimum DateTime value accepted by Dynamicweb (1900/01/01 00:00:00).