Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing date format for text box 1

Status
Not open for further replies.

smurf01

IS-IT--Management
Jul 6, 2002
470
0
0
GB
I wonder if someone can help me, I have created an insert page with a form, on the form i have two textboxes to hold dates, I am calling the dates from a calendar however, the dates are inserted into the calendar in the format mm/dd/yy.

Does anyone know of some code I can use to change the format to dd/mm/yy. any help would be appreciated

Regards

Paul
 
Try this
Code:
strDate = rsYourRecordset.Fields.Item("Your_date").value
dd=DatePart("d", strDate)
if len(dd)=1 then dd= "0" & dd end if
mm=DatePart("m", strDate)
if len(mm)=1 then mm= "0" & mm end if
yy=DatePart("yyyy", strDate)
if len(yy)=2 then yy= "20" & yy end if
strDate = dd & "/" & mm & "/" & yy

Then just response.write strDate wherever you need it

Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks. Visit the forum at
 
In addition to Cheech's suggestion try this tutorial:


pinky1.jpg width='75' height='75'
[/tt]
056.jpg
 
Cheech,
Thanks that works fine

Regards

Paul
 
Nice little tut there AKA

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks. Visit the forum at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top