Loading..
 

Show current date using Javascript in web browser(Client side date in web browser)

For client side scripting,

Go through following lines to product date in DD/MM/YYYY format:

var objToday = new Date();

var dd = objToday.getDate();

var mm = objToday.getMonth() + 1; //January is 0

var yyyy = objToday.getFullYear();

if (dd < 10) { dd = ’0' + dd }

if (mm < 10) { mm = ’0' + mm }

var strToday = dd + ‘/’ + mm + ‘/’ + yyyy;

alert(strToday); // will show like ’17/07/2013'



On, 27/07/2013, 27 July, 2013

Latest News

UK to bring in drone registration
YouTube to redirect searches for IS videos
C-Turtle: The landmine-detecting robot 'turtle'
MoneySuperMarket fined for sending seven million unwanted emails
AI demo picks out recipes from food photos
AlphaBay and Hansa dark web markets shut down
Newcastle University students targeted by cyber-scam
Kodi magazine 'directs readers to pirate content'
Robot 'drowns' in fountain mishap
Bitcoin swings as civil war looms