Skip to content

Commit

Permalink
Merge pull request #230 from raffacabofrio/master
Browse files Browse the repository at this point in the history
Pra corrigir o bug que impede escolher ganhador no dia da decisão.
  • Loading branch information
marcios authored Mar 12, 2019
2 parents 7271e6f + 9f58139 commit 2315907
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ShareBook/ShareBook.Helper/DateTime/DateTimeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ static public TimeSpan GetTimeNowSaoPaulo()
return now - today;
}

// data hora agora.
static public DateTime GetDateTimeNowSaoPaulo() => TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.FindSystemTimeZoneById(SaoPauloTimezoneId));

// data-hora de hoje a meia noite.
static public DateTime GetTodaySaoPaulo()
{
var nowSP = GetTimeNowSaoPaulo();
var todaySP = DateTime.Now.AddHours(nowSP.Hours * -1).AddMinutes(nowSP.Minutes * -1).AddSeconds(nowSP.Seconds * -1);
var nowSP = GetDateTimeNowSaoPaulo();
var todaySP = new DateTime(nowSP.Year, nowSP.Month, nowSP.Day, 0, 0, 0);
return todaySP;
}

Expand Down

0 comments on commit 2315907

Please sign in to comment.