Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: date format??


Message #1 by jon.holyoake@m... on Tue, 30 May 2000 14:28:48
i am trying to insert a the date into my database 

i am using <input type=hidden name=date123 id=date123 value=<%=date%>>





but as a result i get 05/30/00

is there a way to convert this to 30/05/00



any help would be greatly appriciated 

thanks 



Message #2 by "Robert Larsson" <robert.l@m...> on Tue, 30 May 2000 17:45:07 -0700
One way is to do like this:



Day(date) & "/" & Month(date) & "/" & Year(date)



I'm not sure if all the function names are correct. Check out the VBScript

reference manual otherwise.





Mvh,

Robert Larsson!

Web-production Coordinator

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

Mindflow AB | www.mindflow.se | 08-545 635 10





----- Original Message -----

From: <jon.holyoake

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, May 30, 2000 2:28 PM

Subject: [asp_databases] date format??





> i am trying to insert a the date into my database

> i am using <input type=hidden name=date123 id=date123 value=<%=date%>>

>

>

> but as a result i get 05/30/00

> is there a way to convert this to 30/05/00

>

> any help would be greatly appriciated

> thanks

>

>
Message #3 by "Abhijit Natu" <natuu@h...> on Tue, 30 May 2000 20:59:35 +0530
Hi jon,



VBscript "formatdatetime" function but it gives date according to reginal

settings. In vbscript we canot specify the format as we can do it in VB 6.0.





Abhijit



----- Original Message -----

From: <jon.holyoake

To: ASP Databases <asp_databases@p...>

Sent: Tuesday, May 30, 2000 2:28 PM

Subject: [asp_databases] date format??





> i am trying to insert a the date into my database

> i am using <input type=hidden name=date123 id=date123 value=<%=date%>>

>

>

> but as a result i get 05/30/00

> is there a way to convert this to 30/05/00

>

> any help would be greatly appriciated

> thanks

>

>

Message #4 by Mark Everest <Mark.Everest@t...> on Tue, 30 May 2000 16:30:44 +0100
The problem you are having is that the server's system service (that IIS is

running under) has a locale of US.  You can resolve this by setting the

local of your session in the session_onstart as follows....





sub session_onstart



	session.LCID = 2057



end sub



Hope this helps....



-----Original Message-----

From: jon.holyoake

[mailto:jon.holyoake@m...]

Sent: 30 May 2000 15:29

To: ASP Databases

Subject: [asp_databases] date format??





i am trying to insert a the date into my database 

i am using <input type=hidden name=date123 id=date123 value=<%=date%>>





but as a result i get 05/30/00

is there a way to convert this to 30/05/00



any help would be greatly appriciated 

thanks 



Message #5 by "Ken Schaefer" <ken.s@a...> on Wed, 31 May 2000 10:32:57 +1000
When you say you are getting 05/03/00, is this from the Date() function, or

what ends up in your database?



Depending on your answer to the question above, you'll need to make a

different set of changes to solve your problem...



If the answer to the question is the former, then on your server goto the

Regional Settings Control Panel, change the Short Date format into the one

you prefer to use, make sure the box that says "Set as System Default

Locale" is checked (WindowsNT)



Cheers

Ken



----- Original Message -----

From: <jon.holyoake>

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, May 30, 2000 2:28 PM

Subject: [asp_databases] date format??





> i am trying to insert a the date into my database

> i am using <input type=hidden name=date123 id=date123 value=<%=date%>>

>

>

> but as a result i get 05/30/00

> is there a way to convert this to 30/05/00

>

> any help would be greatly appriciated

> thanks





Message #6 by <frontfoot@y...> on Tue, 30 May 2000 19:41:30 -0500
Sure there is.

You string the values together, stuff in var and display var. Try it

<%

strDate = day(date) &"/" & month(date) & "/" & year(date)

%>





date is <%=strDate%>





-----Original Message-----

From: jon.holyoake

Sent: Tuesday, May 30, 2000 2:29 PM

To: ASP Databases

Subject: [asp_databases] date format??





i am trying to insert a the date into my database

i am using <input type=hidden name=date123 id=date123 value=<%=date%>>





but as a result i get 05/30/00

is there a way to convert this to 30/05/00



any help would be greatly appriciated

thanks



Message #7 by <frontfoot@y...> on Tue, 30 May 2000 20:12:30 -0500
<P>and if you want to get fancy you can add leading zeros to days and months

that are less than 10</P>



<%

if day(date)< 10 then

	strDay = "0" & day(date)

else

	strDay = day(date)

end if



if month(date)<10 then

	strMonth = "0" & month(date)

else

	strMonth = month(date)

end if



%>



<%

strD = strDay &"/" & strMonth & "/" & year(date)

%>



<p>

todays date is <%=strD%>



-----Original Message-----

From: jon.holyoake

Sent: Tuesday, May 30, 2000 2:29 PM

To: ASP Databases

Subject: [asp_databases] date format??





i am trying to insert a the date into my database

i am using <input type=hidden name=date123 id=date123 value=<%=date%>>





but as a result i get 05/30/00

is there a way to convert this to 30/05/00



any help would be greatly appriciated

thanks




  Return to Index