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

set TimeZone for version number #13051

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

xuwei-k
Copy link
Contributor

@xuwei-k xuwei-k commented Jul 11, 2021

for reproducible builds

Welcome to Scala 2.13.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_292).
Type in expressions for evaluation. Or try :help.

scala> import java.text.SimpleDateFormat
import java.text.SimpleDateFormat

scala> import java.util.{Date, TimeZone}
import java.util.{Date, TimeZone}

scala> def date(zone: String) = {
     |   val format = new SimpleDateFormat("yyyyMMdd")
     |   format.setTimeZone(TimeZone.getTimeZone(zone))
     |   format.format(new Date(1626043918000L))
     | }
def date(zone: String): String

scala> date("JST")
val res0: String = 20210712

scala> date("UTC")
val res1: String = 20210711

for reproducible builds

```
Welcome to Scala 2.13.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_292).
Type in expressions for evaluation. Or try :help.

scala> import java.text.SimpleDateFormat
import java.text.SimpleDateFormat

scala> import java.util.{Date, TimeZone}
import java.util.{Date, TimeZone}

scala> def date(zone: String) = {
     |   val format = new SimpleDateFormat("yyyyMMdd")
     |   format.setTimeZone(TimeZone.getTimeZone(zone))
     |   format.format(new Date(1626043918000L))
     | }
def date(zone: String): String

scala> date("JST")
val res0: String = 20210712

scala> date("UTC")
val res1: String = 20210711
```
Copy link
Member

@bishabosha bishabosha left a comment

Choose a reason for hiding this comment

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

Nice, thank you

@bishabosha bishabosha merged commit 6631730 into scala:master Jul 12, 2021
@xuwei-k xuwei-k deleted the version-number-TimeZone branch July 12, 2021 09:25
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.

2 participants