-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve time conversion helpers #36
Conversation
31a5ae1
to
a9c65fe
Compare
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.
The new 'scripts' dir needs to be added to the setup.py 'packages' set.
File-like object to write output (default=sys.stdout). Mostly for testing. | ||
""" | ||
if date is None: | ||
if len(sys.argv) > 2: |
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.
No biggie, but I naively tried "cxotime --help" and "cxotime -help" and they weren't helpful as that just throws an exception ValueError: Input values did not match any of the formats where the format keyword is optional
...
So I'm not sure if there is some value to supporting some kind of usage help.
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.
Works for me now.
54d85c8
to
0bd1382
Compare
Description
This improves the time conversion helper utilities which are available as a CLI via the
cxotime
script or theprint_conversions()
method ofCxoTime
.get_conversions()
method.scripts
, now being run throughmain()
.django.setup()
is run if theTZ
environment var is removed.Interface impacts
None
Testing
Unit tests
Functional tests
In [8]: os.environ["TZ"] = "America/Chicago"
In [9]: CxoTime("2022:300:01:00:00.000").get_conversions()
Out[9]:
{'local': '2022 Wed Oct 26 08:00:00 PM CDT',
'iso_local': '2022-10-26T20:00:00-05:00',
'date': '2022:300:01:00:00.000',
'cxcsec': 783219669.184,
'decimalyear': 2022.8192922374428,
'iso': '2022-10-27 01:00:00.000',
'unix': 1666832400.0}