Felix Novovic
06/02/2019, 12:34 PMval now = DateTime(DateTimeZone.UTC)
val inTwoHours = now + Duration.standardHours(2)
println(inTwoHours.millis)
Very simple, I just want to copy the time in millis and put it in another file I'm messing around with. However, when I run the scratch file it evaluates perfectly fine but shows the output to the right of the println
statement which I cannot copy or select. I really like the ideas of scratch files and I believe it to be an invaluable tool when doing some manual testing and experimentation but I cannot seem to find how to just print it to the normal console. Anyone has any clue? (Using IntelliJ Ultimate)tseisel
06/02/2019, 1:21 PMtseisel
06/02/2019, 1:22 PMFelix Novovic
06/02/2019, 1:37 PMimport org.joda.time.DateTime
import org.joda.time.DateTimeZone
import org.joda.time.Duration
data class RandomStuff(val randomStuff: RandomStuff?)
val rnd = RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(RandomStuff(null))))))))))))
val now = DateTime(DateTimeZone.UTC)
val inTwoHours = now + Duration.standardHours(2)
println(inTwoHours.millis)
And I actually got a scratch window open. It doesn't print the line in the console though, but it prints
scratch.kts:7 val rnd: Scratch.RandomStuff
Interesting, thanks for taking your time with some directions 🙂nastelaz
06/03/2019, 11:07 AMFelix Novovic
06/04/2019, 7:10 AM