Skip to content

Commit b183ea4

Browse files
committed
Use VB.NET indexing for months and days ;-)
1 parent 20423c3 commit b183ea4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Serilog.Sinks.File/Sinks/File/RollingIntervalExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public static string GetFormat(this RollingInterval interval)
4646
case RollingInterval.Infinite:
4747
return null;
4848
case RollingInterval.Year:
49-
return new DateTime(instant.Year, 0, 0, 0, 0, 0, instant.Kind);
49+
return new DateTime(instant.Year, 1, 1, 0, 0, 0, instant.Kind);
5050
case RollingInterval.Month:
51-
return new DateTime(instant.Year, instant.Month, 0, 0, 0, 0, instant.Kind);
51+
return new DateTime(instant.Year, instant.Month, 1, 0, 0, 0, instant.Kind);
5252
case RollingInterval.Day:
5353
return new DateTime(instant.Year, instant.Month, instant.Day, 0, 0, 0, instant.Kind);
5454
case RollingInterval.Hour:

0 commit comments

Comments
 (0)