Every line of 'new date .gettime' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
25 function getTime() { 26 var time = Date.parse('2017-05-21'); 27 return new Date(time + 3600 * 1000 * (config.sun - 8)); 28 }
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code
47 function getTime() { 48 return new Date().getTime() 49 }
96 export function createDate(date) { 97 if (typeof date === 'string') { 98 const [dateString, timeString] = date.split(' '); 99 const args = dateString.split('-'); 100 args[1] = args[1] - 1; 101 if (timeString) { 102 args.push.apply(args, timeString.split(':')); 103 } 104 return new Date(...args); 105 } 106 if (!date) return new Date(); 107 return new Date(date); 108 }