Class DateTimeExtensions
- Namespace
- Dynamicweb.Frontend
- Assembly
- Dynamicweb.dll
Provides extension methods for DateTime to facilitate displaying time intervals in a user-friendly format for frontend Razor templates.
public static class DateTimeExtensions
- Inheritance
-
DateTimeExtensions
- Inherited Members
Methods
GetTimeAgo(DateTime)
Returns a TimeAgoInfo object that represents the time elapsed since the specified DateTime in a human-readable format.
public static TimeAgoInfo? GetTimeAgo(this DateTime dateTime)
Parameters
Returns
- TimeAgoInfo
A TimeAgoInfo object containing the value and label of the time elapsed, or
nullif thedateTimeis in the future.