From 7bd91d34aeefd169857be8d670360a26359cf898 Mon Sep 17 00:00:00 2001 From: Luke Couzens Date: Tue, 8 Aug 2023 10:39:02 +0100 Subject: [PATCH] fix dates to match real data (#462) --- nise/__init__.py | 2 +- nise/generators/azure/azure_generator.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nise/__init__.py b/nise/__init__.py index 8768beb5..fb5416b8 100644 --- a/nise/__init__.py +++ b/nise/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.3.1" +__version__ = "4.3.2" VERSION = __version__.split(".") diff --git a/nise/generators/azure/azure_generator.py b/nise/generators/azure/azure_generator.py index 6fc22990..146b7de2 100644 --- a/nise/generators/azure/azure_generator.py +++ b/nise/generators/azure/azure_generator.py @@ -126,6 +126,8 @@ "exchangeRateDate", ) +DATE_FMT = "%Y-%m-%d" + class AzureGenerator(AbstractGenerator): """Defines an abstract class for generators.""" @@ -305,9 +307,9 @@ def _add_common_usage_info(self, row, start, end, **kwargs): row["BillingAccountName"] = self.account_info.get("billing_account_name") row["BillingProfileId"] = self.account_info.get("billing_account_id") row["BillingProfileName"] = self.account_info.get("billing_account_name") - row["Date"] = start.date().strftime("%m/%d/%Y") - row["BillingPeriodStartDate"] = self.first_day_of_month(start).strftime("%m/%d/%Y") - row["BillingPeriodEndDate"] = self.last_day_of_month(start).strftime("%m/%d/%Y") + row["Date"] = start.date().strftime(DATE_FMT) + row["BillingPeriodStartDate"] = self.first_day_of_month(start).strftime(DATE_FMT) + row["BillingPeriodEndDate"] = self.last_day_of_month(start).strftime(DATE_FMT) else: row["SubscriptionGuid"] = self.subscription_guid row["UsageDateTime"] = start