skip to main |
skip to sidebar
RSS Feeds
ASP.NET, JavaScript, Oracle and SQL articles and code.
ASP.NET, JavaScript, Oracle and SQL articles and code.
12:13 PM
Posted by Michael Heliso
The followinf function will return current date in dd/mm/yyyy format.
/*Define the namespaces*/ var JavaScript = {}; JavaScript.Utils = {}; JavaScript.Utils.Date = {}; JavaScript.Utils.Date.Current = function(){ var current = new Date(); //In JavaScript Date object the months counter starts from 0, so //we have to correct this. current.setMonth(current.getMonth() + 1); var changedDate = current.getDate() + "/" + current.getMonth() + "/" + current.getYear(); return changedDate; }