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 criticises security of Huawei products
Zuckerberg in Holocaust denial row
PUBG game apologises for 'offensive mask'
Money to help Trump immigrants rejected
Google's Loon brings internet-by-balloon to Kenya
Roblox blames 'gang rape' on hacker adding code to game
Google hit with €4.3bn Android fine from EU
3D-printed gun blueprints given go-ahead by US government
Fortnite: Schools 'could learn lessons from gaming'
Apple iCloud: State firm hosts user data in China