Using an expression to get the current date may be something you would like to do for demonstration purposes on your dashboard. Here is an example on how to use the javascript inside of a expression to get the Date.
var today=new Date();
var dd=today.getDate();
var mm=today.getMonth()+1;
var yy=today.getYear()+1900;
Y1=mm+'/'+dd+'/'+yy;
Using an expression to get Julian date may also be something that your business could utilize to do Date based formulas. Below is an expression used to get Julian Date.
Date.prototype.getJulian = function() {
return Math.floor((this / 86400000) - (this.getTimezoneOffset()/1440) + 2440587.5);
}
var today = new Date();
var julian = today.getJulian();
Y1=julian;
For both examples set the Data Type as a String!
Comments
0 comments
Please sign in to leave a comment.