Visual Basic: Calculate Sunday, other date examples

So, you have a page in ASP or a script of some kind that needs to be based on a Sunday.  Here's a quick code snipped for "rounding" a date to the Sunday.

sundayThisWeek = Date() - Weekday(Date()) + 1
sundayNextWeek = sundayThisWeek + 7
sundayAfterNext = sundayNextWeek + 7

source:
http://www.codingforums.com/showthread.php?t=162987

 

Date portion, only:

todaysDate=now()
Response.write FormatDateTime(todaysDate,2)

http://www.codetoad.com/asp/format_date_time.asp

 


tags: asp, vbscript, visual basic, week,


 

Related Scribbles:
  • Visual Basic Notes
  • VBscript / ASP Notes


  • ID: 925
    Author:
    leonard
    Date Updated:
    2011-12-13 13:52:11
    Date Created:
    2009-04-29 11:22:12

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> Visual Basic: Calculate Sunday, other date examples
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.