Dates in a Querystring

Results 1 to 3 of 3

Thread: Dates in a Querystring

  1. #1
    Join Date
    Dec 1969

    Default Dates in a Querystring

    I have a link that holds a date in a variable in the querystring. alldates?iDate=<BR><BR>I cannot get it to pull a true date. I need it to work just like this site does when you view older forum posts.<BR><BR>i tried using IsDate, trim, Cstr. Any help?

  2. #2
    Join Date
    Dec 1969

    Default RE: Dates in a Querystring

    [code language="VBScript"]<BR>Dim allDates<BR> allDates = Request.QueryString("iDate")<BR> If IsDate(allDates) Then<BR> allDates = CDate(allDates)<BR> Else<BR> Response.Write "Invalid date provided."<BR> Response.End<BR> End If<BR>[/code]

  3. #3
    Join Date
    Dec 1969

    Default Possibly need to encode it...

    &#060;%<BR>URL = "alldate.asp?iDate=" & Server.URLEncode(yourDateVariable)<BR>%&#062;<BR>< BR>In JS code:<BR><BR>&#060;SCRIPT&#062;<BR>var url = "alldate.asp?iDate=" + escape( yourDateVariable.toString() );<BR>&#060;/SCRIPT&#062;<BR><BR>Except that a JS variable converted to string might make a value that VBS&#039;s CDATE won&#039;t understand, so you might need a custom conversion function.<BR><BR>

Posting Permissions

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