var date = new Date();
date ; //# => Fri Apr 01 2011 11:14:50 GMT+0200 (CEST)
date.setDate(date.getDate() - 1);
date ; //# => Thu Mar 31 2011 11:14:50 GMT+0200 (CEST)
More Related Contents:
- How to calculate number of days between two dates?
- Get difference between 2 dates in JavaScript? [duplicate]
- Convert a Unix timestamp to time in JavaScript
- Get week of year in JavaScript like in PHP
- How do you display JavaScript datetime in 12 hour AM/PM format?
- Javascript add leading zeroes to date
- Difference between two dates in years, months, days in JavaScript
- JavaScript seconds to time string with format hh:mm:ss
- Get the time difference between two datetimes
- Comparing date part only without comparing time in JavaScript
- Get String in YYYYMMDD format from JS date object?
- new Date() works differently in Chrome and Firefox
- how to parse a “dd/mm/yyyy” or “dd-mm-yyyy” or “dd-mmm-yyyy” formatted date string using JavaScript or jQuery [duplicate]
- Parsing a string to a date in JavaScript
- new Date() is working in Chrome but not Firefox
- What is the best way to determine the number of days in a month with JavaScript?
- getMonth in javascript gives previous month
- ToLocaleDateString() changes in IE11
- “Deprecation warning: moment construction falls back to js Date” when trying to convert RFC2822 date in moment.js
- How to format a UTC date as a `YYYY-MM-DD hh:mm:ss` string using NodeJS?
- Check if one date is between two dates
- How to JSON stringify a javascript Date and preserve timezone
- Javascript library for human-friendly relative date formatting [closed]
- how to determine if date is weekend in javascript [closed]
- Calculate Timezone offset only for one particular timezone
- How to split a string at the first `/` (slash) and surround part of it in a “?
- Format date and Subtract days using Moment.js
- Javascript Invalid Date Error in Internet Explorer
- How to change Gregorian date to Persian date in JavaScript?
- toISOString() return wrong date