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

Dates are changing in the server since there is a common use in SimpleDateFormat which is not thread safe #179

Closed
itaiag opened this issue Dec 28, 2017 · 0 comments

Comments

@itaiag
Copy link
Contributor

itaiag commented Dec 28, 2017

We need to synchronize it, use Thread Local or change to Java 8 DateTimeFormatter

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String str = new java.util.Date().toInstant()
                                 .atZone(ZoneId.systemDefault())
                                 .format(formatter);

More information in this StackOverflow thread

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

1 participant