Skip to content

add posix time formatting #225

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

Merged
merged 2 commits into from
Apr 5, 2016
Merged

Conversation

kostiakoval
Copy link
Contributor

Add posix functions for getting and formatting time.
This function is required in RP #122.

@kostiakoval kostiakoval mentioned this pull request Mar 27, 2016
4 tasks
libc.time(&time)
let result = libc.ctime(&time)

return String(cString: result)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't return type be Double

Copy link
Contributor

Choose a reason for hiding this comment

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

okay I see its not unix ts

@kostiakoval kostiakoval force-pushed the posix-time branch 3 times, most recently from 7b5f1bd to 99f893a Compare March 29, 2016 20:27
@kostiakoval
Copy link
Contributor Author

After studying this topic I think it would be better to Use Thread Safe Functions
gmtime_r and etc. Any feedback on that idea?

http://linux.die.net/man/3/gmtime

@mxcl
Copy link
Contributor

mxcl commented Mar 31, 2016

Probably, yes. Currently we are single thread, but that will change as Swift gains concurrency primitives.

@kostiakoval
Copy link
Contributor Author

Done, use TS functions and added error handling.
@mxcl review please :)

@mxcl
Copy link
Contributor

mxcl commented Apr 4, 2016

@swift-ci Please test

@kostiakoval
Copy link
Contributor Author

test are passing, shall we merge it?

@mxcl
Copy link
Contributor

mxcl commented Apr 4, 2016

Please 👍🏻

@kostiakoval kostiakoval merged commit 3c05641 into swiftlang:master Apr 5, 2016
@kostiakoval kostiakoval deleted the posix-time branch April 8, 2016 15:15
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.

4 participants