-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect time span for accumulatedCost report last 7 days cost includes 8 days in range #130
Comments
Also note that the time period covered seems to be bounded by the 1st of each month rather than be a rolling 7 days cost. For example, on May 6 the time period will only be from May 1 to May 6. It shows the same as month-to-date before the 8th of each month. |
Regarding the time period covered: As for the main issue, I wonder if this could be something to do with time zone differences as the code date assessment uses UtcNow in combo with DateOnly. lastSevenDaysCost = accumulatedCostDetails.Costs.Where(a => a.Date >= DateOnly.FromDateTime(DateTime.UtcNow.AddDays(-7))) |
It does seem the labels for the values can be misleading depending on whether a custom timeframe is used or not. For example, when specifying a timeframe of a 7 day period there is still a value for 'lastThirtyDaysCost'. Of course, it is the same as 'lastSevenDaysCost' in that instance. Thanks for clarifying the behavior - I'll just need to run the script 2 times: once to get month to date and once to get rolling 30- and 7-day stats. I am in US Central time zone and generally running the command in the AM. My version (today) is 0.39.0+526ada73468d88e535e0f8e4f84b21405b3be4fb. The script I wrote as a wrapper updates azure-cost each time before running the command. |
If you are in Central time as UTC -5, then the only period that your date (day of the month) is behind UTC is from midnight to 5am UTC time (7pm to midnight Central time). I think. I am terrible with times and dates. I am in Australia UTC + 10 and have this sort of thing often with different things, UTC date changes at 10am for us and we are ahead in date for 10 hours each morning. It does raise an interesting discussion around weather the app needs to be time zone aware when doing periods like this, but the data that comes back from Microsoft is in UTC, I think. So may make sense to do it the way it is doing it, but maybe in a more explicit way that makes it obvious. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
totals, lastSevenDaysCost includes an 8 day period - the previous 7 days plus today. So for example it is returning Tuesday April 2 to Tuesday April 9, inclusive.
The text was updated successfully, but these errors were encountered: