For years I have been formatting dates in Groovy with:
import java.text.SimpleDateFormat
println new SimpleDateFormat("yyyy-MM-dd HH.mm.ss.SSSSS Z").format(new Date())
Then I recently learned you can just do this without importing anything:
println new Date().format("yyyy-MM-dd HH.mm.ss.SSSSS Z")
Top comments (0)