From 70c2188c525ab1b4559e704e785d166e0ffb1e8f Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Wed, 14 Feb 2024 09:50:25 +0000 Subject: [PATCH] fix time step in mars --- ecml_tools/create/functions/mars.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ecml_tools/create/functions/mars.py b/ecml_tools/create/functions/mars.py index 58b7c49..fa2ed6c 100644 --- a/ecml_tools/create/functions/mars.py +++ b/ecml_tools/create/functions/mars.py @@ -47,10 +47,11 @@ def _expand_mars_request(request, date): step = to_list(request.get("step", [0])) for s in step: r = deepcopy(request) + base = date - datetime.timedelta(hours=int(s)) r.update( { - "date": date.strftime("%Y%m%d"), - "time": date.strftime("%H%M"), + "date": base.strftime("%Y%m%d"), + "time": base.strftime("%H%M"), "step": s, } )