You may want to try
var d = new Date();
d.toLocaleString(); // -> "2/1/2013 7:37:08 AM"
d.toLocaleDateString(); // -> "2/1/2013"
d.toLocaleTimeString(); // -> "7:38:05 AM"
More Related Contents:
- How do you display JavaScript datetime in 12 hour AM/PM format?
- Date is in string format
- Convert a Unix timestamp to time in JavaScript
- What are valid Date Time Strings in JavaScript?
- Convert seconds to HH-MM-SS with JavaScript?
- JavaScript seconds to time string with format hh:mm:ss
- Get the time difference between two datetimes
- How to convert date to timestamp?
- How to parse a time into a Date object from user input in JavaScript?
- Get first and last date of current month with JavaScript or jQuery [duplicate]
- Getting current date and time in JavaScript
- Get time of specific timezone [duplicate]
- How do I calculate how many seconds between two dates?
- different result for yyyy-mm-dd and yyyy/mm/dd in javascript when passed to “new Date” [duplicate]
- Calculate Timezone offset only for one particular timezone
- Making a live clock in javascript
- Format JavaScript date as yyyy-mm-dd
- How to convert a Date to UTC?
- Get month name from Date
- Incrementing a date in JavaScript
- Javascript – get array of dates between 2 dates
- Difference in Months between two dates in JavaScript
- Invalid date in safari
- How to create a date object from string in javascript [duplicate]
- Converting 24 hour time to 12 hour time w/ AM & PM using Javascript
- Javascript: parse a string to Date as LOCAL time zone
- Calculating the difference between two dates
- Format Date time in AngularJS
- Javascript Date Plus 2 Weeks (14 days)
- Convert decimal day to HH:MM