diff --git a/app/DynamicsAdapter/DynamicsAdapter.Web/PersonSearch/SearchResultService.cs b/app/DynamicsAdapter/DynamicsAdapter.Web/PersonSearch/SearchResultService.cs index 19050130..54f8affe 100644 --- a/app/DynamicsAdapter/DynamicsAdapter.Web/PersonSearch/SearchResultService.cs +++ b/app/DynamicsAdapter/DynamicsAdapter.Web/PersonSearch/SearchResultService.cs @@ -194,7 +194,8 @@ public async Task ProcessPersonFound( FirstName = t1TaxInfos.FirstOrDefault()?.FirstName, LastName = t1TaxInfos.FirstOrDefault()?.LastName, DateOfBirth = t1TaxInfos.FirstOrDefault()?.DateOfBirth, - Date1 = DateTime.Now, + // Date1 = DateTime.Now, + Date1 = GetPacificTimeNow(), // Temporary code see jira ticket FAMS3-4305 SuppliedBySystem = Constants.JcaSystem, TaxIncomeInformations = t1TaxInfos }; @@ -208,6 +209,21 @@ public async Task ProcessPersonFound( return true; } + // ***** Temporary method, made it private so it is not to be used outside of this class + // time should be stored in UTC and dynamics should be timezone aware when presenting the date/time in the UI + // see jira ticket FAMS3-4305 + private static DateTime GetPacificTimeNow() + { + // get UTC date time + DateTime utcNow = DateTime.UtcNow; + // Use IANA ID for Linux containers + TimeZoneInfo pacificZone = TimeZoneInfo.FindSystemTimeZoneById("America/Vancouver"); + + // Convert UTC to Pacific Time + return TimeZoneInfo.ConvertTimeFromUtc(utcNow, pacificZone); + } + + public async Task GetSearchRequest(string fileId, CancellationToken token) { return await _searchRequestService.GetSearchRequest(fileId, _cancellationToken); @@ -402,7 +418,8 @@ private async Task UploadTaxIncomeInformations( txin.Description = matchedCode?.Value ?? taxinfo.Description ?? taxinfo.TaxCode.Code; txin.InformationSource = Constants.JcaSystem; - txin.Date1 = DateTime.Now; + // txin.Date1 = DateTime.Now; + txin.Date1 = GetPacificTimeNow(); // Temporary code see jira ticket FAMS3-4305 var uploadedTxin = await _searchRequestService.CreateTaxIncomeInformation(txin, cancellationToken); if (uploadedTxin != null) @@ -465,7 +482,8 @@ private async Task UploadFinancialOtherIncome( otherin.Description = finIncome.Description ?? finIncome.TaxCode?.Code; otherin.TaxYear = finIncome.TaxYear; otherin.Form = finIncome.Form; - otherin.Date = DateTime.Now; + // otherin.Date = DateTime.Now; + otherin.Date = GetPacificTimeNow(); // Temporary code see jira ticket FAMS3-4305 otherin.InformationSource = Constants.JcaSystem; var uploadedOtherin = await _searchRequestService.CreateFinancialOtherIncome(otherin, cancellationToken);