Groovy web console

subscribe to the feed Subscribe
to this
site

Unixtime

Published 1 month ago by alvaroteixeira with tags 1
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import java.text.SimpleDateFormat 
def unixtimetodate(long dateUnix) {
    Date dateObj =  new Date( ((long)dateUnix) * 1000 )
    def cleanDate = new SimpleDateFormat('dd/MM/yyyy hh:mm:ss').format(dateObj)
    return cleanDate
 }

unixtimetodate(1591743677)