Created
March 25, 2018 05:20
-
-
Save prateekiiest/be2932a25b311153d72fc39401c745f9 to your computer and use it in GitHub Desktop.
Enhancement for _parse_dt64
This file contains 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
import astropy.Time as T | |
def _parse_dt64(dt): | |
""" | |
Parse a single numpy datetime64 object | |
""" | |
# Validate (in an agnostic way) that we are getting a datetime rather than a date | |
s= ((dt.astype(T.Time).timetuple()[:6])) | |
return T.Time('{}-{}-{}'.format(*s)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment