Skip to content

fix(transcribe): align timestamp conversion with UTC+1 offset - #1

Merged
KonWol merged 2 commits into
ipal-ids:masterfrom
goonstream:patch-1
Aug 13, 2026
Merged

fix(transcribe): align timestamp conversion with UTC+1 offset#1
KonWol merged 2 commits into
ipal-ids:masterfrom
goonstream:patch-1

Conversation

@goonstream

Copy link
Copy Markdown
Contributor

The source data in attacks.json appears to have been generated using a UTC+1 base, despite being Singapore-based. Standard UTC or UTC+8 conversions result in a 7-8 hour discrepancy. This change forces the parsed datetime to UTC+1 before converting to a timestamp, ensuring an exact match with the existing dataset (e.g., matching 1451294954).

The source data in attacks.json appears to have been generated using a UTC+1 base, despite being Singapore-based. Standard UTC or UTC+8 conversions result in a 7-8 hour discrepancy. 
This change forces the parsed datetime to UTC+1 before converting to a timestamp, ensuring an exact match with the existing dataset (e.g., matching 1451294954).

@KonWol KonWol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for your PR! Indeed we did not test our code for different timezones.

Comment thread SWaT/transcribe.py
#!/usr/bin/env python3
import gzip
import json
from datetime import datetime

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please fix this line to comply with isort? Then your PR will be ready for merging.

isort --profile black --filter-files -c --skip EnergyDataset/manipulateTraces/ .
ERROR: ./datasets/SWaT/transcribe.py Imports are incorrectly sorted and/or formatted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @KonWol, thanks for the quick review! 
I have just run isort to fix the import sorting and pushed the update.Thanks again!

@KonWol
KonWol merged commit 2fae854 into ipal-ids:master Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants