trying to maintain date format

Results 1 to 5 of 5

Thread: trying to maintain date format

  1. #1
    ASP Doofus Guest

    Default trying to maintain date format

    I have an application that runs a stored procedure to retrieve a session variable for &#039;last close of business&#039; from a database. That value is used by default to populate the app&#039;s query date. Unfortunately, when I output this value in &#060;%=&#062; tags, it&#039;s in the wrong format, even though it returns in the procedure correctly (ie--the output value is "4/6/2001" when it should be "04/06/2001"). Is anyone can tell me where this conversion might be made and how to prevent it, I&#039;d greatly appreciate it. By the way,the web server&#039;s regional date settings are correct (dd/mm/yyyy).<BR><BR>Thank you in advance.

  2. #2
    Freddie Spencer Guest

    Default RE: trying to maintain date format

    Try using FormatDateTime() function...<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Write a Function

    &#060;%<BR>function ConvertToNewDate(OldDate)<BR>dim sDate<BR><BR> if month(OldDate) &#060; 10 then<BR> sDate = "0" & month(OldDate)<BR> else<BR> sDate = month(OldDate)<BR> end if<BR> if day(OldDate) &#060; 10 then<BR> sDate = sDate & "0" & day(OldDate)<BR> else<BR> sDate = sDate & day(OldDate)<BR> end if<BR> sDate = sDate & Year(OldDate)<BR> ConvertToNewDate = sDate<BR> <BR>end function<BR>%&#062;<BR><BR>Regards,<BR>Rob

  4. #4
    JB Guest

    Default WOW... Nice logic

    I like the way you fixed that problem. Can&#039;t figure out why something that easy is so difficult for some of us. Probably just a matter of time and experience. I&#039;ll use that idea myself. Thanks Rob.

  5. #5
    Join Date
    Dec 1969

    Default RE: WOW... Nice logic

    My Pleasure....

Posting Permissions

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