Skip to main content
Version: 2.11.10

Humanizer.PrepositionsExtensions

PrepositionsExtensions Class

System.DateTime extensions related to spatial or temporal relations

public static class PrepositionsExtensions

Inheritance System.Object → PrepositionsExtensions

Methods

PrepositionsExtensions.At(this DateTime, int, int, int, int) Method

Returns a new System.DateTime with the specifed hour and, optionally provided minutes, seconds, and milliseconds.

public static System.DateTime At(this System.DateTime date, int hour, int min=0, int second=0, int millisecond=0);

Parameters

date System.DateTime

hour System.Int32

min System.Int32

second System.Int32

millisecond System.Int32

Returns

System.DateTime

PrepositionsExtensions.AtMidnight(this DateTime) Method

Returns a new instance of DateTime based on the provided date where the time is set to midnight

public static System.DateTime AtMidnight(this System.DateTime date);

Parameters

date System.DateTime

Returns

System.DateTime

PrepositionsExtensions.AtNoon(this DateTime) Method

Returns a new instance of DateTime based on the provided date where the time is set to noon

public static System.DateTime AtNoon(this System.DateTime date);

Parameters

date System.DateTime

Returns

System.DateTime

PrepositionsExtensions.In(this DateTime, int) Method

Returns a new instance of DateTime based on the provided date where the year is set to the provided year

public static System.DateTime In(this System.DateTime date, int year);

Parameters

date System.DateTime

year System.Int32

Returns

System.DateTime