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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert german date to us date

Status
Not open for further replies.

x75

Programmer
Mar 8, 2002
10
DE
Hi I have some asp code that used to be on a german win nt server. now it is on an english server. The problem is that all dates read from my database are now in the wrong format.
because in german you write a date day.month.year and in english its month/day/year iis thier a way how I can convert them automaticly?

Thanks for any help.
Johannes
 
I think you can use the vbscript datePart() function to select each part of the date from the german date. For example you can use <% month=DatePart(&quot;D&quot;, Date) %> to get the month from the german date. Then once you have each part of the date, you can use dateAdd() to create the US date from the german date parts. has great examples on how to use vbscript datepart.
-Hope this works for you
 
Checked it out and it does not work. It turns 25/3/02 into day 2. Maybe parse the date parts using other vbscript functions, and then use dateAdd().
 
Thanks
for your help.
I found out that the only way to solve my problem is to have the isp set the default code page to german.
because it occurs in all different parts of my code, and rewriteing it will take to long.

thank again
 
You can put this at the top of your pages or include files:

<%@ LCID = 1033 %>

<% Session.LCID = 1033 %>


this should work.

1033 is for North America
1031 is Germany

-------------

Jeannette :->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top