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

Datetime subtraction #115

Closed
brookewenig opened this issue Apr 20, 2019 · 1 comment
Closed

Datetime subtraction #115

brookewenig opened this issue Apr 20, 2019 · 1 comment

Comments

@brookewenig
Copy link

I can't subtract two datetimes from each other. I can do this in pandas without issues. See this notebook: https://databricks-prod-cloudfront.cloud.databricks.com/public/793177bc53e528530b06c78a4fa0e086/0/12638605/100107/latest.html

Tony would like to show off this feature in his blog.

Screen Shot 2019-04-18 at 9 32 36 AM

@rxin
Copy link
Contributor

rxin commented Apr 21, 2019

What's the return type of date subtraction and timestamp subtraction for Pandas?

In Spark there is a datediff function and perhaps we can use that to do date subtraction. It'd return the number of days.

There is also to_unix_timestamp that turns a timestamp into the number of seconds and we can use that to compute the diff (in secs) between two timestamp values.

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

No branches or pull requests

3 participants