Skip to content

Conversation

@koconnor99-aq
Copy link
Contributor

No description provided.

Comment on lines 119 to 120
startts:?[not null tab[`timezone];ltime[.tz.ttz[`GMT;tab[`timezone];startts]];startts];
endts:?[not null tab[`timezone];ltime[.tz.ttz[`GMT;tab[`timezone];endts]];endts];
Copy link
Member

Choose a reason for hiding this comment

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

do definitely we want to use ltime here? I think that will depend on whether the process is running with -localtime flag set to true or false?

Comment on lines 119 to 120
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];gtime[startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];gtime[endts]];endts];
Copy link
Member

Choose a reason for hiding this comment

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

Is the user has set -localtime 0 (or not set it, which defaults to 0 I think), I think this will be wrong? gtime will convert the timestamp to GMT by applying the offset from local time, but if -localtime 0, the time is already GMT, so we don't want to do any conversion?

I think there'll need to be some sort of conditional here based on the -localtime setting?

Comment on lines 119 to 120
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[startts];startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[endts];endts]];endts];
Copy link
Member

Choose a reason for hiding this comment

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

I think you can just check .proc.localtime here, and probably use $ instead of ?

Suggested change
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[startts];startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[endts];endts]];endts];
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];$[.proc.localtime;gtime[startts];startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];$[.proc.localtime;gtime[endts];endts]];endts];

Co-authored-by: Jonathon McMurray <jonathon.mcmurray@aquaq.co.uk>
Copy link
Member

@jonathonmcmurray jonathonmcmurray left a comment

Choose a reason for hiding this comment

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

looks good - do you have a set of test cases to validate these changes? I think we need to verify the following scenarios:

  • timezone specified for report (timezone different to local timezone), -localtime set
  • timezone specified for report (timezone different to local timezone), -localtime not set
  • timezone specified for report (timezone same as local timezone), -localtime set
  • timezone specified for report (timezone as local timezone), -localtime not set
  • timezone not specified for report, -localtime set
  • timezone not specified for report, -localtime not set

(may be some others I'm not thinking of)

Ideally if we can create unit tests for all of these that'd be great.

@koconnor99-aq
Copy link
Contributor Author

looks good - do you have a set of test cases to validate these changes? I think we need to verify the following scenarios:

  • timezone specified for report (timezone different to local timezone), -localtime set
  • timezone specified for report (timezone different to local timezone), -localtime not set
  • timezone specified for report (timezone same as local timezone), -localtime set
  • timezone specified for report (timezone as local timezone), -localtime not set
  • timezone not specified for report, -localtime set
  • timezone not specified for report, -localtime not set

(may be some others I'm not thinking of)

Ideally if we can create unit tests for all of these that'd be great.

Will get working on these now, thanks Jonathon

@jonnypress
Copy link
Contributor

@koconnor99-aq did you get a chance to close this out? Or could you hand over to someone else to close out please?

@koconnor99-aq
Copy link
Contributor Author

koconnor99-aq commented Jun 17, 2024 via email

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.

4 participants