Forum Discussion
Lucian
Community Hero
Hey,
This is a piece of code which should work:
import java.text.SimpleDateFormat // Get timestamp def timestamp = 1526199928404 // Set a date using the timestamp def date = new Date( timestamp ) // Create a date format as desired SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd hh:mm" ) // Display your date in the defined format log.info dateFormat.format( date )
Cheers!
N78A
7 years agoContributor
Hi ,
Thanks for your response. Tried the option you suggested but it gives me error:
""Illlegal argument for below line ,
def date = new Date( timestamp )
Related Content
- 9 years ago
Recent Discussions
- 15 years ago