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: 6.0.0+cfb73701cda54e2410b006f649f072e90daef707
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