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

Add Day of Year Support #396

Closed
ZachDischner opened this issue Dec 18, 2016 · 1 comment · Fixed by #655
Closed

Add Day of Year Support #396

ZachDischner opened this issue Dec 18, 2016 · 1 comment · Fixed by #655

Comments

@ZachDischner
Copy link

It would be excellent to be able to include 3 digit day-of-year support for date formats.

For example, using datetime

In [14]: datetime.datetime.strptime("2016-360","%Y-%j")
Out[14]: datetime.datetime(2016, 12, 25, 0, 0)

The equivalent with arrow could be

arrow.get("2016-360")

For background, most of the datetimes I work with for spacecraft telemetry timestamping utilizes the day-of-year format since it is is pretty locale agnostic (2016/12/11 vs 2016/11/12).

@Zamubafoo
Copy link

While an implementation of the 'j' token would be a nice feature, you can easily extract the date into arrow without much trouble:

dayOfYear=arrow.Arrow.strptime("2016-360","%Y-%j")

This gets you to the correct time inside an Arrow object which is easy to work with, then you can export it via:

dayOfYear.strftime("%Y-%j")

It's nothing amazing, but it definitely beats datetime and the bunch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants