Link to home
Start Free TrialLog in
Avatar of johnhardy
johnhardyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Jmail date format

I have a line in an asp page.  jmail

MailObj.appendHTML (rsinput.Fields.Item("AssignEnteredDate").Value)
This causes the date to be displayed in American format when the message arrives.
The access database table shows the date in UK format
How can I change the format to show UK format please?
Many thanks
John
Avatar of Rouchie
Rouchie
Flag of United Kingdom of Great Britain and Northern Ireland image

Capture the date value into a variable first, then extract the appropriate sections of the date and rebuild it...


Dim theDate = rsinput.Fields.Item("AssignEnteredDate").Value
MailObj.appendHTML (Day(theDate) & "/" & Month(theDate) & "/" & Year(theDate))

Open in new window

Avatar of Joe Wu
Avatar of johnhardy

ASKER

<%
Dim theDate = rsinput.Fields.Item("AssignEnteredDate").ValueMailObj.appendHTML (Day(theDate) & "/" & Month(theDate) & "/" & Year(theDate))
%>
I placed this code near the top of the page but it brings an error
line 5, column 12
Dim theDate = rsinput.Fields.Item("AssignEnteredDate").ValueMailObj.appendHTML (Day(theDate) & "/" & Month(theDate) & "/" & Year(theDate))
Make sure you are pasting 2 seperate lines of code - your post looks like its somehow combined into 1.

Dim theDate = rsinput.Fields.Item("AssignEnteredDate").Value
MailObj.appendHTML (Day(theDate) & "/" & Month(theDate) & "/" & Year(theDate))

Let me know the error if it persists.
Sorry yes I didnt copy it in as I should.
However I still get the error message below looks like it does not like the = sign

line 5, column 12
Dim theDate = rsinput.Fields.Item("AssignEnteredDate").Value
-----------^
ASKER CERTIFIED SOLUTION
Avatar of Rouchie
Rouchie
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Rouchie
Its now working GREAT!

btw as you have used both is it worth changing from .asp to asp.net?
 
Definitely yes, simply to avoid all the little pitfalls that make life hard with ASP.  The problem is that it works quite differently and has lots more power, so there's quite a steep learning curve.

The tutorials videos on www.asp.net though are a really good place to start should you have a spare few days on your hands :-)