Join Dotnetcodes DotnetCodes.com is online Discussion Forum for Software professionals . It lets you find friends around the world and Create professional network that share similar interests as you. Get help on ur projects by industry specialists. Also get answers to all ur technical/placement related querries.Get an edge over others.
Already MemberClick here to login
ASP.net MVC Interview Questions Answers Interview Questions
Serial Number in SSRS Articles
Get Started Developing for Android Apps with Eclipse Articles
How to Print a Crystal Report direct to printer Articles
Razor View Engine Interview Questions Answers Interview Questions
.Net framework 4.0 Interview Questions Answers Interview Questions
SQL server reporting services Interview Questions (SSRS) part 1 Articles
Whats New in ASP.NET 4.0 Part 2 Articles
Difference between Encapsulation and Abstraction Interview Questions
Explaining SDLC -System Development Life Cycle Articles
SPIRE PDF Library Articles
Infosys Interview Questions Interview Questions
Html5 interview questions and answers Interview Questions
Dynamic Menu using HTML List Tag and CSS in ASP.Net Articles
SharePoint 2010 interview Questions Answers Interview Questions
Submit Articles | More Articles..

How do I write the current date and time in javascript

Posted By: rakesh on 7/2/2010 3:28:00 AM | Comments:1 [Forward This]
How do I write out the current date and time using JavaScript?

Dear Friends, Dont forget to bookmark and submit your posting to social websites listed above.It will bring more visibility, buzz and fast action to attend your post

Responses to the Discussion: How do I write the current date and time in javascript
Reply by: rakesh on: 7/9/2010 12:14:17 AM
hey, This is how you create a date object and store it in a variable: var now = new Date(); The "new Date()" part of the above statement creates the date object. The "var now =" part causes the date object to be stored in the variable named "now". How To Extract Information From that Date Object Lots of information can be extracted from a date object. In this tutorial, we ll extract only what we ll need: var hour = now.getHours(); var minute = now.getMinutes(); var second = now.getSeconds(); var monthnumber = now.getMonth(); var monthday = now.getDate(); var year = now.getYear(); Notice that the name of the variable containing the date object and a period are followed by the function name. The function extracts the information from the date object and stores it in the variable named on the left of the equal sign. All of the function names are intuitive except getDate(), which gets the day of the month rather than a date. Do not confuse "getDate()" with "new Date()" -- the former, as stated, extracts the day of the month from a date object. The latter creates the date object itself.
 
You have not Logged In,  click here to Login
Reply Here
 
, I agree the terms and conditions of this website
  
Similar Discussion
Can I use HTML instead of Javascript?    Asked by: rakesh
java    Asked by: sinha
How do I write the current date and time in javascript    Asked by: rakesh
how to use regular expression in javascript    Asked by: rakesh
Ask Questions | All Similar Discussions..
  .NET Framework
  ADO.NET
  AJAX
  Android
  ASP.NET
  ASP.NET AJAX
  ASP.NET MVC
  Azure
  Best Practices
  BizTalk Server
  C++
  CSharp
  CSS
  DBMS
  Error and Resolution
  HTML
  IIS
  JAVA
  JavaScript
  JQwery
  JSP
  LINQ
  Management
  Mobile
  ODP.NET
  OOPS
  Oracle
  Others
  Pattern and Practices
  PHP
  SAP
  SEO
  SharePoint
  Silverlight
  Sql Server
  SSAS
  SSIS
  SSRS
  Survey
  UML
  UNIX
  VB
  VB.NET
  VS 2010
  WCF
  Web Analytics
  Windows Forms
  WPF
  WWF
  XML
  XSLT
  .NET Framework
  ADO.NET
  AJAX
  Android
  ASP.NET
  ASP.NET AJAX
  ASP.NET MVC
  Azure
  Best Practices
  BizTalk Server
  C++
  CSharp
  CSS
  DBMS
  Error and Resolution
  HTML
  IIS
  JAVA
  JavaScript
  JQwery
  JSP
  LINQ
  Management
  Mobile
  ODP.NET
  OOPS
  Oracle
  Others
  Pattern and Practices
  PHP
  SAP
  SEO
  SharePoint
  Silverlight
  Sql Server
  SSAS
  SSIS
  SSRS
  Survey
  UML
  UNIX
  VB
  VB.NET
  VS 2010
  WCF
  Web Analytics
  Windows Forms
  WPF
  WWF
  XML
  XSLT

Advertise About Us Private Policy Terms of use
All rights reserved to dotnetcodes. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
Best viewed at 1024 x 768 resolution with Internet Explorer 5.0 or Mozila Firefox 3.5 or Google Crome and higher