Class DateTimeExtensions
Extension methods for System.DateTime
Inheritance
System.Object
DateTimeExtensions
Namespace: EPiServer.Commerce.Extensions
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0Syntax
public static class DateTimeExtensions : Object
Methods
FormatTimeSince(DateTime)
Displays the time since an object was sent
Declaration
public static string FormatTimeSince(this DateTime dateTime)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | dateTime | The send time of the object |
Returns
Type | Description |
---|---|
System.String | If time is within the current day, the time will be returned as number of hours and minutes, else the time will be returned as a short date string |
FormatTimeSince(DateTime, LocalizationService)
Displays the time since an object was sent
Declaration
public static string FormatTimeSince(this DateTime dateTime, LocalizationService localizationService)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | dateTime | The send time of the object |
EPiServer.Framework.Localization.LocalizationService | localizationService | The localization service. |
Returns
Type | Description |
---|---|
System.String | If time is within the current day, the time will be returned as number of hours and minutes, else the time will be returned as a short date string |