Skip to content

Commit 67f4ddb

Browse files
authored
Merge pull request #261 from simplify9/hamza/fix/seed-timestamp-timezone
Fix timezone-dependent seed timestamp breaking CI
2 parents 3295a77 + 0a715e6 commit 67f4ddb

4 files changed

Lines changed: 2553 additions & 11 deletions

File tree

‎SW.Bitween.Api/Data/BitweenDbContext.cs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ public class BitweenDbContext : DbContext
1818
private readonly RequestContext requestContext;
1919
private readonly IPublish publish;
2020

21-
protected readonly DateTime defaultCreatedOn = DateTime.Parse("1/1/2022");
21+
// Parsed as Unspecified kind, so the .ToUniversalTime() calls at every use site below used
22+
// to convert using whatever timezone the current machine happened to be in — deterministic
23+
// on any one developer's machine, but different on every other machine/CI runner, which
24+
// permanently disagreed with whichever machine last regenerated the migration snapshot.
25+
protected readonly DateTime defaultCreatedOn = DateTime.SpecifyKind(DateTime.Parse("1/1/2022"), DateTimeKind.Utc);
2226

2327
// Mtm@dmin!2
2428
protected readonly string defaultPasswordHash =

0 commit comments

Comments
 (0)