Click or drag to resize

FileTargetCalculateNextWeekday Method

Calculate the DateTime of the requested day of the week.

Namespace:  NLog.Targets
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public static DateTime CalculateNextWeekday(
	DateTime previousLogEventTimestamp,
	DayOfWeek dayOfWeek
)

Parameters

previousLogEventTimestamp
Type: SystemDateTime
The DateTime of the previous log event.
dayOfWeek
Type: SystemDayOfWeek
The next occurring day of the week to return a DateTime for.

Return Value

Type: DateTime
The DateTime of the next occurring dayOfWeek.
Remarks
For example: if previousLogEventTimestamp is Thursday 2017-03-02 and dayOfWeek is Sunday, this will return Sunday 2017-03-05. If dayOfWeek is Thursday, this will return *next* Thursday 2017-03-09.
See Also