current date with dare function js code example Example: calculate today date javascript var today = new Date();