• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class DateUtils

Provides utility methods to work with Dates.

Inheritance
System.Object
DateUtils
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public class DateUtils : object

Methods

| Improve this Doc View Source

CalculateDateForDisplay(DateTime)

Returns a string with the pretty printed amount of time since the specified date.

Declaration
public static string CalculateDateForDisplay(DateTime date)
Parameters
Type Name Description
DateTime date

DateTime in UTC.

Returns
Type Description
System.String

String representing the required date for display.

| Improve this Doc View Source

GetDatabaseDateTimeOffset()

Gets DateTime Offset of current DB.

Declaration
public static TimeZoneInfo GetDatabaseDateTimeOffset()
Returns
Type Description
TimeZoneInfo

DateTimeOffset object.

| Improve this Doc View Source

GetDatabaseLocalTime()

Gets the database server's local time of the DB server and not the web server's local time.

Declaration
public static DateTime GetDatabaseLocalTime()
Returns
Type Description
DateTime

Date/time of the database in UTC.

| Improve this Doc View Source

GetDatabaseTime()

Gets the database time.

Declaration
public static DateTime GetDatabaseTime()
Returns
Type Description
DateTime

Date/time of the database in UTC.

| Improve this Doc View Source

GetDatabaseUtcTime()

Gets the database server's time in UTC.

Declaration
public static DateTime GetDatabaseUtcTime()
Returns
Type Description
DateTime

Date/time of the database in UTC.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS