Date format

Results 1 to 3 of 3

Thread: Date format

  1. #1
    Join Date
    Dec 1969

    Default Date format

    There is date/time field in my database and date 3.10.2000. When I use PWS and pages on my computer, date format is ok. But if I use same pages and database on my service provider&#039s server, date format change 3.10.2000 to 10/3/2000. How I have to configure IIS? Can I change date format on IIS to form 3.10.2000 without touching IIS settings?<BR><BR>Thank you for answers

  2. #2
    Join Date
    Dec 1969

    Default RE: Date format

    The quick and dirty way would be like this:<BR><BR>dDate = setYourDateVariableHere<BR>sDate = Replace(Cstr(dDate), "/", ".")<BR><BR>that will convert the 10/3/2000 date to 10.3.2000

  3. #3
    DaveL Guest

    Default RE: Date format

    You can use this code to ensure that your date appears in UK format (dd/mm/yyyy) no matter where your server is located.<BR>FYI servers in the US (most of them) always format dates as mm/dd/yyyy.<BR><BR>&#060;%<BR>Sub ShowUKdate()<BR><BR> dim dateStr, UKdate<BR> dateStr=split(date,"/")<BR><BR>&#039add leading zero to single figures<BR><BR> if Len(dateStr(0))&#060;2 then<BR> dateStr(0)="0"&dateStr(0)<BR> end if<BR><BR> if Len(dateStr(1))&#060;2 then<BR> dateStr(1)="0"&dateStr(1)<BR> end if<BR><BR> dateStr(2)=right(year(now),2)<BR><BR> if Int(dateStr(0))=month(now) then<BR> UKdate=dateStr(1)&"/"&dateStr(0)&"/"&dateStr(2)<BR> else<BR> UKdate=join(dateStr,"/")<BR> end if<BR><BR> response.write UKdate<BR>End Sub<BR><BR>%&#062;<BR><BR><BR>The date in the UK is &#060;% ShowUKdate %&#062;<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