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

3D-printed gun pioneer in jail on sex assault charge
Code-cracking WW2 Bombe operation recreated at Bletchley
Women harassed after seeking sperm donors online
Facebook stops sending staff to help political campaigns
Tech Tent: Do the police have your biometric digits?
Amazon makes Alexa-controlled microwave
China blocks Twitch game-streaming service
Instagram's IGTV recommended 'abusive' videos
Internet regulator considered for UK
GoPro Hero 7 camera films smooth videos without gimbal