Hermes2: Submission of deletion events in local time
Motivation
----------
Hermes2 submits the deletion events in local time. It needs to be changed to UTC.


diff --git a/lib/rucio/daemons/hermes/hermes2.py b/lib/rucio/daemons/hermes/hermes2.py
index 11dd1e64f..9199848a7 100644
--- a/lib/rucio/daemons/hermes/hermes2.py
+++ b/lib/rucio/daemons/hermes/hermes2.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 #
 # Authors:
-# - Cedric Serfon <cedric.serfon@cern.ch>, 2020
+# - Cedric Serfon <cedric.serfon@cern.ch>, 2020-2021
 # - Benedikt Ziemons <benedikt.ziemons@cern.ch>, 2020
 # - Mario Lassnig <mario.lassnig@cern.ch>, 2020
 
@@ -354,8 +354,8 @@ def aggregate_to_influx(messages, bin_size, endpoint, prepend_str):
         elif event_type in ['deletion-failed', 'deletion-done']:
             created_at = message['created_at']
             if bin_size == '1m':
-                created_at = created_at.replace(second=0, microsecond=0)
-            created_at = int(created_at.strftime('%s')) * 1000000000
+                created_at = created_at.replace(second=0, microsecond=0, tzinfo=datetime.timezone.utc).timestamp()
+            created_at = int(created_at) * 1000000000
             created_at += microsecond
             if created_at not in bins:
                 bins[created_at] = {}
['lib/rucio/daemons/hermes/hermes2.py']