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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current month

Status
Not open for further replies.

stingman1

Programmer
May 28, 2000
53
US
Hello I was wondering how to get the current month to show in VBscript either as a name or the number of the current month. I am trying to make a script to prorate a charge but I have to know the current month to know how many days there are in that month. If anyone could help me figure that out I would apreciate it. <p>Steve Hagerman<br><a href=mailto:Admin@Advancedisp.com>Admin@Advancedisp.com</a><br><a href= ISP high speed internet access</a><br>I did it my way!
 
Try this:<br><br>To get the date:<br>Dim dbCurrentDate<br>dbCurrentDate = Date()<br><br>to get number of the month:<br>Dim NumofMonth<br>NumofMonth = Month(dbCurrentDate)<br><br>To get number of days in the month:<br>Dim iDaysinMonth = DatePart(&quot;d&quot;,DateSerial(year(dbCurrentDate), Month(dbCurrentDate)+1, 1-1)<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top