Example #1
0
 public IActionResult Json()
 {
     return(Json(new
     {
         Id = 1,
         // real UTC datetime
         UtcDate = DateTime.UtcNow.ToString(),
         // UTC datetime converted by DateTimeConverter
         UtcDateConvertedByDateTimeConverter = DateTime.UtcNow,
         // user local time
         LocalTime = _userCulture.GetUserLocalTime()
     }));
 }
Example #2
0
 public void ReturnUserLocalTime()
 {
     _mockedTimeService.SetupGet(x => x.Now).Returns(_utcTime);
     Assert.Equal(_userLocalTime, _sut.GetUserLocalTime());
 }