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

Unix timestamps and Filesystem timestamps would be Useful #1

Open
zippy1981 opened this issue Jul 29, 2015 · 2 comments
Open

Unix timestamps and Filesystem timestamps would be Useful #1

zippy1981 opened this issue Jul 29, 2015 · 2 comments

Comments

@zippy1981
Copy link

Converting between VBA Dates and seconds since the unix epoch would be useful things to have. Do they belong in this library?

@timhall
Copy link
Member

timhall commented Jul 31, 2015

Hmm, I'll research Unix time a little more, but it looks like it'd fit well here.

@timhall
Copy link
Member

timhall commented Jul 31, 2015

Found the following:

http://stackoverflow.com/questions/12325948/excel-vba-convert-a-date-string-to-a-unix-timestamp
https://en.wikipedia.org/wiki/Unix_time
http://www.unixtimestamp.com/

Tested this against the last link and seems to be working:

Function ConvertToUnix(LocalDate As Date)
  DateDiff("s", DateSerial(1970, 1, 1), UtcConverter.ConvertToUtc(LocalDate))
End Function

I'll add more tests and ParseUnix and add it to VBA-UTC soon. Thanks for the suggestion.

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

No branches or pull requests

2 participants