Skip to content

timestamps without enough zeros#518

Merged
martindurant merged 1 commit into
fsspec:mainfrom
martindurant:timestamp2
Jan 13, 2023
Merged

timestamps without enough zeros#518
martindurant merged 1 commit into
fsspec:mainfrom
martindurant:timestamp2

Conversation

@martindurant
Copy link
Copy Markdown
Member

Following #516

@martindurant martindurant merged commit 23180f8 into fsspec:main Jan 13, 2023
@martindurant martindurant deleted the timestamp2 branch January 13, 2023 15:27
Comment thread gcsfs/core.py
UTC = timezone(timedelta(0))
return datetime.fromisoformat(timestamp[:-1]).astimezone(UTC)
timestamp = timestamp[:-1]
timestamp = timestamp + "0" * (6 - len(timestamp.rsplit(".", 1)[1]))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

timestamp.rjust(desired_length_here, '0')

would have worked well here as well

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That might have been more elegant, but this works too :)

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.

2 participants