Click or drag to resize
DisplayFrom Method
moment([2007, 0, 29]).fromNow(); // 4 years ago moment([2007, 0, 29]).fromNow(showSuffix: false); // 4 years Emulates http://momentjs.com/docs/#/displaying/fromnow/

Namespace: MomentSharp
Assembly: MomentSharp (in MomentSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static string From(
	this Moment moment,
	DateTime dateTime = null,
	bool showSuffix = true
)

Parameters

moment
Type: MomentSharpMoment
Moment
dateTime (Optional)
Type: SystemDateTime
Uses DateTime.UtcNow if not provided
showSuffix (Optional)
Type: SystemBoolean
Shows "number part ago" or "in number part"

Return Value

Type: String
Localized string e.g. 4 years ago

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Moment. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also