如果我有这样的代码:
def yourDate= new GregorianCalendar( 2010, Calendar.OCTOBER, 1 )
SimpleDateFormat date=new SimpleDateFormat("yyyy-mm-dd");
def d=date.parse(yourDate);
groovy 中有什么函数可以给我毫秒数吗?
最佳答案
有两种方法:
def date1= new Date()
println date1.getTime()
def date2= System.currentTimeMillis()
println date2
关于java - 在 groovy 中获取毫秒数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45612137/