Date conversion problem

H

Hugh Welford

Hi...
I am in UK using XP with date format set to dd/mm/yy. I am running an asp
site from a server in USA, which is returning the date from a database field
retrieved as objrec("todate") in US format mm/dd/yy.

To rectify this so as not to confuse visitors to the site I am trying to get
the date displayed as dd month yy , e.g. 25 January 04 by using the format
function format(objrec("todate"), "d-mmmm-yy"). This returns me a VBScript
runtime error "Type mismatch: 'format' "

The data base field "todate" is stored in short date format, which should be
OK shouldnt it?

Can someone explain what I am doing wrong... Thanks for your help Hugh
 
B

Brynn

Function dateConv(theDate)
Dim arr, newdate: arr=split(theDate,"/")
newdate = arr(1) & "/" & arr(0) & "/" & arr(2)
dateConv = day(newdate) & " " & monthname(month(newdate)) & "
" & year(newdate)
End FUnction

Hi...
I am in UK using XP with date format set to dd/mm/yy. I am running an asp
site from a server in USA, which is returning the date from a database field
retrieved as objrec("todate") in US format mm/dd/yy.

To rectify this so as not to confuse visitors to the site I am trying to get
the date displayed as dd month yy , e.g. 25 January 04 by using the format
function format(objrec("todate"), "d-mmmm-yy"). This returns me a VBScript
runtime error "Type mismatch: 'format' "

The data base field "todate" is stored in short date format, which should be
OK shouldnt it?

Can someone explain what I am doing wrong... Thanks for your help Hugh

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
H

Hugh Welford

Thanks for your help everyone


Brynn said:
Function dateConv(theDate)
Dim arr, newdate: arr=split(theDate,"/")
newdate = arr(1) & "/" & arr(0) & "/" & arr(2)
dateConv = day(newdate) & " " & monthname(month(newdate)) & "
" & year(newdate)
End FUnction



Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

UPDATE record 3
date formats 2
Date problem 2
Validate date 6
Date 2
Date in database 32
Short date problem with ASP 5
date problems with interdev objects 2

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top