Date functions in ASP

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: Date functions in ASP

    ISDATE(...)

    or if you want to find the last day of the current month,

    set the date to the first, add one month using dateadd, minus 1 day.

    cheers

    martin.

    "Tim Johnson" <timj@smithscity.co.nz> wrote in message
    news:070a01c345cc$f9312ba0$a501280a@phx.gbl...
    > I was wanting to know if there is a function in ASP that
    > is able to check if a date is valid or not. I know the
    > IsDate function, but its not (I think) quite what I'm
    > after.
    >
    > I have 3 drop down boxes on my page - Month/Day/Year. Is
    > there a function that would check "31 Febuary 2003" - and
    > tell me that this is an invalid date?
    >
    > TIA.

    martin de vroom Guest

  2. Similar Questions and Discussions

    1. VB Date functions into ISO format for SQL server
      Hi everyone, I am developing a advertising portal site for villa rentals. In which we require to charge for advertising on a 6 or 12 month basis....
    2. Date Interval Functions
      On a form I have Date_Start Date_End I have a new Date_Start1 Date_End1 which the use...
    3. #10743 [Com]: class functions & PHP core functions inconsistently clash ;)
      ID: 10743 Comment by: destes at ix dot netcom dot com Reported By: jjones at net-conex dot com Status: Open...
    4. ASP & Date Functions
      Hi, I was wondering if there was a function in ASP that checks a date to see if it is valid or not. I am aware of the IsDate function, but I...
    5. DB2 Date and Holiday Calendar functions.
      People, Has anyone had occasion to implement holiday functionality into a DB2 calendar of sorts ? I'm looking for suggested ways of implementing...
  3. #2

    Default Re: Date functions in ASP

    Tim Johnson wrote:
    > I was wanting to know if there is a function in ASP that
    > is able to check if a date is valid or not. I know the
    > IsDate function, but its not (I think) quite what I'm
    > after.
    >
    > I have 3 drop down boxes on my page - Month/Day/Year. Is
    > there a function that would check "31 Febuary 2003" - and
    > tell me that this is an invalid date?
    >
    > TIA.
    You can use DateSerial and catch the error when it's given an invalid date.

    A better strategy is to not allow an invalid date to be selected in the
    first place. It's pretty simple to write a sub that reloads the Day dropdown
    with the valid days for the month and year combination in the onchange
    events of those dropdowns. Give it a try and if you get stuck, ask for help
    on a client-side scripting newsgroup such as m.p.scripting.vbscript or
    m.p.scripting.jscript (or find a newsgroup with dhtml in its title)

    HTH,
    Bob Barrows


    Bob Barrows Guest

  4. #3

    Default Re: Date functions in ASP

    Please don't multipost. What does this have to do with databases?





    "Tim Johnson" <timj@smithscity.co.nz> wrote in message
    news:070a01c345cc$f9312ba0$a501280a@phx.gbl...
    > I was wanting to know if there is a function in ASP that
    > is able to check if a date is valid or not. I know the
    > IsDate function, but its not (I think) quite what I'm
    > after.
    >
    > I have 3 drop down boxes on my page - Month/Day/Year. Is
    > there a function that would check "31 Febuary 2003" - and
    > tell me that this is an invalid date?
    >
    > TIA.

    Aaron Bertrand [MVP] Guest

  5. #4

    Default Re: Date functions in ASP

    You are exactly right, it has nothing to do with
    databases, my intention was not to multi-post but when I
    posted the below I didn't realise I was in DB and to my
    knowledge there is no way to remove a post?

    >-----Original Message-----
    >Please don't multipost. What does this have to do with
    databases?
    >
    >
    >
    >
    >
    >"Tim Johnson" <timj@smithscity.co.nz> wrote in message
    >news:070a01c345cc$f9312ba0$a501280a@phx.gbl...
    >> I was wanting to know if there is a function in ASP
    that
    >> is able to check if a date is valid or not. I know the
    >> IsDate function, but its not (I think) quite what I'm
    >> after.
    >>
    >> I have 3 drop down boxes on my page - Month/Day/Year.
    Is
    >> there a function that would check "31 Febuary 2003" -
    and
    >> tell me that this is an invalid date?
    >>
    >> TIA.
    >
    >
    >.
    >
    Tim Johnson Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139