www.webdeveloper.com
Results 1 to 3 of 3

Thread: creating dates

  1. #1
    Join Date
    Mar 2004
    Location
    Folkestone. UK
    Posts
    104

    creating dates

    Hi,

    I am trying to create a holiday system, where users will enter their start date of the holiday, then the number of days.
    Is there anyway of getting asp to work out that if holiday starts on 23/March and lasts for 5 days that the end date will be 27, but also I need this to create a entry in the DB that says "booked" on the days in between?

    TIA

    Steve
    There's no point running if you are on the wrong road

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    Yes. VBScript has some nifty date handling methods -- DateAdd() being one of them.
    Code:
    DateAdd("d", 5, "10-Feb-05") // Should return "15-Feb-05"
    In your case, you would use it as follows:
    Code:
    DateAdd("d", intLengthOfHoliday, dteStartDate)
    See here for documentation: http://www.w3schools.com/vbscript/func_dateadd.asp

    Regards.

  3. #3
    Join Date
    Mar 2004
    Location
    Folkestone. UK
    Posts
    104
    Buntine thanks very much
    There's no point running if you are on the wrong road

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles