Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get First Day of Month

Status
Not open for further replies.

SDyke

MIS
Oct 13, 2005
55
US
How do I get the first day(date) of the month.

This dosn't seem to work

seeddate = new Date();
date = new Date() - seeddate.getDate();
 
The first day (date) of every month is 1.

Or do you mean you want to get the day of the week of the first day of the month?

Lee
 
Code:
theFirst = new Date();
theFirst.setDate(1);
[tt]setDate[/tt] sets the day of the month for the [tt]Date[/tt] object (from 1 to 31). Then you can do whatever you want with [tt]theFirst[/tt], like get the day of the week.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top