diff --git a/docs/my-website/docs/proxy/budget_reset_and_tz.md b/docs/my-website/docs/proxy/budget_reset_and_tz.md index 541ff6a2f0..340e33afe1 100644 --- a/docs/my-website/docs/proxy/budget_reset_and_tz.md +++ b/docs/my-website/docs/proxy/budget_reset_and_tz.md @@ -29,5 +29,6 @@ Common timezone values: - `US/Pacific` - Pacific Time - `Europe/London` - UK Time - `Asia/Kolkata` - Indian Standard Time (IST) +- `Asia/Bangkok` - Indochina Time (ICT) - `Asia/Tokyo` - Japan Standard Time - `Australia/Sydney` - Australian Eastern Time diff --git a/litellm/litellm_core_utils/duration_parser.py b/litellm/litellm_core_utils/duration_parser.py index 08e5323c30..9a317cfcf0 100644 --- a/litellm/litellm_core_utils/duration_parser.py +++ b/litellm/litellm_core_utils/duration_parser.py @@ -158,6 +158,7 @@ def _setup_timezone( "US/Eastern": timezone(timedelta(hours=-4)), # EDT "US/Pacific": timezone(timedelta(hours=-7)), # PDT "Asia/Kolkata": timezone(timedelta(hours=5, minutes=30)), # IST + "Asia/Bangkok": timezone(timedelta(hours=7)), # ICT (Indochina Time) "Europe/London": timezone(timedelta(hours=1)), # BST "UTC": timezone.utc, } diff --git a/tests/test_litellm/litellm_core_utils/test_duration_parser.py b/tests/test_litellm/litellm_core_utils/test_duration_parser.py index b6e73dab6b..cebad07c07 100644 --- a/tests/test_litellm/litellm_core_utils/test_duration_parser.py +++ b/tests/test_litellm/litellm_core_utils/test_duration_parser.py @@ -88,6 +88,12 @@ class TestStandardizedResetTime(unittest.TestCase): ) self.assertEqual(london_result, london_expected) + # Test Bangkok timezone (UTC+7): 5:30 AM next day, so next reset is midnight the day after + bangkok = ZoneInfo("Asia/Bangkok") + bangkok_expected = datetime(2023, 5, 17, 0, 0, 0, tzinfo=bangkok) + bangkok_result = get_next_standardized_reset_time("1d", base_time, "Asia/Bangkok") + self.assertEqual(bangkok_result, bangkok_expected) + def test_edge_cases(self): """Test edge cases and boundary conditions""" # Exactly on hour boundary