-
Notifications
You must be signed in to change notification settings - Fork 86
eodtime bugfix #31
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
Merged
Merged
eodtime bugfix #31
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3b771ce
Fix for eodtime bug, change to rolltime offset
jonathonmcmurray 2743489
Add safety check in TP for EOD rollover
jonathonmcmurray 7149a8f
Updating documentation, adding TP,eodtime to docs
jonathonmcmurray 5921499
Fixing error message, docs
jonathonmcmurray dd0a9ee
Improving efficiency
jonathonmcmurray 292fcd0
Merge branch 'master' into eodtime_bugfix
jonathonmcmurray 96c16a7
fixing docs
jonathonmcmurray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,34 @@ | ||
| / - system eodtime configuartion | ||
| / - loaded into and used in the tp and pdb processes | ||
| \d .eodtime | ||
| rolltime:@[value;`rolltime;0D00:00:00.000]; | ||
| datatimezone:@[value;`datatimezone;`$"GMT"]; | ||
| rolltimezone:@[value;`rolltimezone;`$"GMT"]; | ||
| dayoffset:@[value;`dayoffset;0]; | ||
| getdailyadjustment:{first exec adjustment from aj[`timezoneID`gmtDateTime;([]timezoneID:enlist .eodtime.datatimezone;gmtDateTime:enlist .z.p); .tz.t]}; | ||
| dailyadj:getdailyadjustment[]; | ||
| adjrolltime:{[p] | ||
| z:rolltime - first exec adjustment from aj[`timezoneID`gmtDateTime;([]timezoneID:enlist .eodtime.rolltimezone;gmtDateTime:enlist p); .tz.t]; | ||
| z:$[z >= 1D;z - 1D;z] // don't let it go past one day | ||
| } | ||
| getroll:{[p] | ||
| z:adjrolltime[p]; | ||
| ("d"$p) + $[z <= p;z+1D;z] // if past time already today, make it tomorrow | ||
| } | ||
| getday:{[p] | ||
| z:adjrolltime[p]; | ||
| ("d"$p) + dayoffset+$[z > p;-1;0] // if not past roll time, subtract one day | ||
| } | ||
| d:getday[.z.p]; | ||
| nextroll:getroll[.z.p]; | ||
| / - system eodtime configuraion | ||
| / - loaded into and used in the tp and pdb processes | ||
| \d .eodtime | ||
|
|
||
| // default settings | ||
| rolltimeoffset:@[value;`rolltimeoffset;0D00:00:00.000]; // offset from standard midnight rollover | ||
| datatimezone:@[value;`datatimezone;`$"GMT"]; // timezone for stamping data | ||
| rolltimezone:@[value;`rolltimezone;`$"GMT"]; // timezone for EOD roll | ||
|
|
||
| // function to determine offset from UTC for timestamping data | ||
| getdailyadjustment:{exec adjustment from .tz.t asof `timezoneID`gmtDateTime!(.eodtime.datatimezone;.z.p)}; | ||
|
|
||
| dailyadj:getdailyadjustment[]; // get offset when loading process and store it in dailyadj | ||
|
|
||
| // function to determine offset from UTC for EOD roll | ||
| adjtime:{[p] | ||
| :exec adjustment from .tz.t asof `timezoneID`gmtDateTime!(.eodtime.rolltimezone;.z.p); | ||
| }; | ||
|
|
||
| // function to get time (in UTC) of next roll after UTC timestamp, p | ||
| getroll:{[p] | ||
| z:rolltimeoffset-adjtime[p]; // convert rolltimeoffset from rolltimezone to UTC | ||
| z:`timespan$(mod) . "j"$z, 1D; // force time adjust to be between 0D and 1D | ||
| ("d"$p) + $[z <= p;z+1D;z] // if past time already today, make it tomorrow | ||
| }; | ||
|
|
||
| // function to determine the date (in rolltimezone) from UTC timestamp, p | ||
| getday:{[p] | ||
| p+:adjtime[p]; // convert date from UTC to rolltimezone | ||
| "d"$p-rolltimeoffset // adjust day according to rolltimeoffset | ||
| }; | ||
|
|
||
| d:getday[.z.p]; // get current date when loading process, store in d | ||
| nextroll:getroll[.z.p]; // get next roll when loading process, store in nextroll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe mention that a list of availble timezones can be found in .tz.t?