Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed datetime errors for tasmania #1055

Merged
merged 2 commits into from
Aug 24, 2023
Merged

fixed datetime errors for tasmania #1055

merged 2 commits into from
Aug 24, 2023

Conversation

majesticio
Copy link
Contributor

timezone was being incorrectly assigned.

@majesticio majesticio requested review from yunica and russbiggs August 1, 2023 19:05
@russbiggs
Copy link
Member

can you provide a bit more detail on how the timezone was incorrect? do we need to correct all the previous data?

@majesticio
Copy link
Contributor Author

original:

const date = DateTime.fromFormat(
      string.trim(),
      'HHmmss',
      'Australia/Hobart'
    );

update:

const date = DateTime.fromFormat(
      string.trim(),
      'HHmmss',
      { zone: 'Australia/Hobart' }
    );

old measurement obj:

 {
      location: 'Cygnet',
      city: 'Tasmania Region',
      date: {
        utc: '2023-08-01T11:10:07Z',
        local: '2023-08-01T05:10:07-06:00'
      },
    }

new measurement obj:

{
      location: 'Cygnet',
      city: 'Tasmania Region',
      date: {
        utc: '2023-08-01T19:10:07Z',
        local: '2023-08-02T05:10:07+10:00'
      }
}

Unfortunately it looks like the fetch data will need to be updated.

@russbiggs
Copy link
Member

@majesticio OK so it looks like the data we have is off due to the timezone issue, but why does this cause a 15 hour gap in the measurements?

@majesticio
Copy link
Contributor Author

majesticio commented Aug 2, 2023

@russbiggs I can't understand why (could be grabbing the timezone from my local machine) but date.zone.name returns America/Denver (UTC -6). With the fix it returns Australia/Hobart (UTC +10/11 ) so that seems to be the cause

@russbiggs
Copy link
Member

@majesticio That sounds like its pulling from your machine. I guess I'm curious how this fixes the gap though, there seems to be two disparate issues. Can you confirm (through testing) that this will fetch the values we are currently missing in that 15 hour gap? I just dont see how the timezone fix would resolve that, but I am perhaps not seeing some of the other logic of the adapter.

@majesticio
Copy link
Contributor Author

@russbiggs The AWS us-east-1 region operates in the Eastern Standard Time (EST, UTC -5). On the other hand, Australia/Hobart operates at Australian Eastern Standard Time (AEST, UTC +10). When I ran it locally with the unfixed code the adapter used my local machine time of Denver (UTC -6). An AWS instance running in Eastern Standard Time (EST, UTC -5) explains the 15 hour gap we see with the measurements.

@russbiggs russbiggs merged commit b2f175d into main Aug 24, 2023
@russbiggs russbiggs deleted the fix/tasmania branch August 24, 2023 19:13
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