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

Function to convert unix timestamp to DateTime? #63

Closed
justinwoo opened this issue Sep 15, 2017 · 5 comments
Closed

Function to convert unix timestamp to DateTime? #63

justinwoo opened this issue Sep 15, 2017 · 5 comments

Comments

@justinwoo
Copy link

It's just a combination of existing functions, I guess, but could be nice to have as a "go to solution"

@garyb
Copy link
Member

garyb commented Sep 15, 2017

Isn't that toDateTime in Data.DateTime.Instant?

@paulyoung
Copy link

I've been using parse from purescript-js-date and then toDateTime.

I opening purescript-contrib/purescript-js-date#15 about how parse is somewhat unsafe.

@paulyoung
Copy link

To clarify; the toDateTime I referenced is from Data.JSDate, not this package.

@hdgarrood
Copy link
Contributor

If "unix timestamp" is meant in the sense of "an int32 number of seconds since midnight, Jan 1, 1970", then this function is essentially toDateTime as @garyb pointed out. If "unix timestamp" is meant in the sense of the string output of the unix date command, e.g.

Fri 25 Sep 12:51:49 BST 2020

then this is out of scope for this library, according to the readme. Should we close this?

@JordanMartinez
Copy link
Contributor

Sure.

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

5 participants