Created
January 29, 2020 08:35
-
-
Save gonaumov/cc60cc8fafc74da937f8291a6efeda70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// here never.created is Data | |
// formatter is SimpleDateFormat("y-M-d H:m:s") | |
// with timeZone = TimeZone.getTimeZone("UTC") | |
// The problem is that this comparison | |
// working properly on UTC+0 | |
// When I set timeZone = TimeZone.getDefault() | |
// it starts to work on every other timezone | |
// instead UTC. The question is how to fix | |
// that in shortest way? Maybe to calculate | |
// current timezone offset and just to | |
// add it to never.created.time? I tried that | |
// with no luck. :( | |
assertThat(never.created.time). | |
isEqualTo(formatter.parse("2019-08-23 15:50:00").time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment