Results 1 to 3 of 3

Thread: Comparing Dates - need some help

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Hampton Beach
    Posts
    35

    Question Comparing Dates - need some help

    I want to take the server date and compare it to two static dates. I want to then be able to manipulate the dates on the dtpicker control.

    Here is the code that I have but it does not work... It doesnt go into the if condition. The problem i am trying to solve is on users pcs there is various date formats which affect the date. 12/01/01 on another machine can be 01/12/01... I need to take all dates as one format mm/dd/yy and compare it to the two dates I have specified. If the date is between that period then make the dtpicker1.mindate = 12/01/01



    Here is my code
    I have an asp page:

    I have a text box taking the value of the date

    <input id=text1 name=text1 value="<%=Date%>">

    then i have :

    <script Lanaguage = "vbscript">
    sub Window_Onload

    Check = text1.value

    if Check >= #01/01/01# and Check <= #02/02/01# then
    msgbox(Check)
    end if

    end sub
    I really appreciate your time!

  2. #2
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    the dd/mm mm/dd phenonomonomonon is down to the user's machines regional settings.

    To get around this you can try converting the date to a long date i.e. 10 January 2001 or get the integer value of the date CInt(DATE) or something similar, that will not use their regional settings.
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Hampton Beach
    Posts
    35
    What is the syntax for the long date format?
    I really appreciate your time!

Posting Permissions

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



Click Here to Expand Forum to Full Width