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 SourceCalculateDateForDisplay(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. |
GetDatabaseDateTimeOffset()
Gets DateTime Offset of current DB.
Declaration
public static TimeZoneInfo GetDatabaseDateTimeOffset()
Returns
Type | Description |
---|---|
TimeZoneInfo | DateTimeOffset object. |
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. |
GetDatabaseTime()
Gets the database time.
Declaration
public static DateTime GetDatabaseTime()
Returns
Type | Description |
---|---|
DateTime | Date/time of the database in UTC. |
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. |