Forum Discussion
Lucian
7 years agoCommunity 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!
- N78A7 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
- 11 months ago
Recent Discussions
- 14 hours ago
- 2 days ago
- 3 days ago
- 3 days ago