how to get current date and time in jaggery js?

272 Views Asked by At

I am working in wso2 data analytical server. I'm using query to get data based on timestamp but I have given time stamp manually. Please tell me how to get current date and time together in milliseconds in jaggery js ?

2

There are 2 best solutions below

0
On BEST ANSWER
var currentDate = new Date();
Math.round(Date.parse(currentDate) / 1000);
var end = Date.parse(currentDate) // Converting in Timestamp 
1
On

You can call java within jaggery. So these should work.

var milis = java.lang.System.currentTimeMillis();
var date = new java.util.Date().toString();