File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
package demo
2
2
3
- import java .time .{OffsetDateTime , Instant , LocalDateTime , ZoneId }
3
+ import java .time .{ Instant , LocalDateTime , OffsetDateTime , ZoneId }
4
4
import java .time .zone .ZoneRulesProvider
5
5
import java .time .format ._
6
6
// import java.util.Locale
@@ -10,10 +10,11 @@ object DemoApp {
10
10
println(LocalDateTime .ofInstant(Instant .now, ZoneId .systemDefault).toString())
11
11
println(ZoneRulesProvider .getAvailableZoneIds)
12
12
// Locale.setDefault(Locale.forLanguageTag("fi-FI"))
13
- val instant = Instant .ofEpochMilli(0 )
14
- val datetime = LocalDateTime .ofInstant(Instant .now, ZoneId .of(" Europe/Helsinki" ))
13
+ val instant = Instant .ofEpochMilli(0 )
14
+ val datetime = LocalDateTime .ofInstant(Instant .now, ZoneId .of(" Europe/Helsinki" ))
15
15
val formatter = DateTimeFormatter .ofPattern(" yyyy/MM/dd HH:mm:ss" )
16
- val odt = OffsetDateTime .parse(" 2011-12-03T10:15:30+01:00" , DateTimeFormatter .ISO_OFFSET_DATE_TIME )
16
+ val odt =
17
+ OffsetDateTime .parse(" 2011-12-03T10:15:30+01:00" , DateTimeFormatter .ISO_OFFSET_DATE_TIME )
17
18
val strRepl = odt.format(formatter)
18
19
println(instant)
19
20
println(datetime)
You can’t perform that action at this time.
0 commit comments