navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

<%=date%>

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> <%=date%>
Page: [1]
 
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
<%=date%> - 2/3/2008 18:49:54   
<%=date%> gives 2/3/2008 format I need to get 02/03/2008 format any idea please?

< Message edited by box -- 2/3/2008 18:55:18 >
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: <%=date%> - 2/4/2008 13:39:48   
<% function fixTheDate(dateIn)
tempText = ""
If IsDate(dateIn) Then

If len(DatePart("d",dateIn)) = 1 Then
tempText = tempText & "0" & DatePart("d",dateIn) & "/"
Else
tempText = tempText & DatePart("d",dateIn) & "/"
End If

If len(DatePart("m",dateIn)) = 1 Then
tempText = tempText & "0" & DatePart("m",dateIn) & "/"
Else
tempText = tempText & DatePart("m",dateIn) & "/"
End If

fixTheDate = tempText & DatePart("yyyy",dateIn)

else ' if not a date, send back an empty string

fixTheDate = ""

end if
end function

response.write(fixTheDate(Date())
%>


Something like that maybe?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to box)
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
RE: <%=date%> - 2/6/2008 2:41:57   
Thanks, it works great, the problem is if I use it as hidden value in the form I get syntax error!!!:)
<% function fixTheDate(dateIn)
tempText = ""
If IsDate(dateIn) Then

If len(DatePart("d",dateIn)) = 1 Then
tempText = tempText & "0" & DatePart("d",dateIn) & "/"
Else
tempText = tempText & DatePart("d",dateIn) & "/"
End If

If len(DatePart("m",dateIn)) = 1 Then
tempText = tempText & "0" & DatePart("m",dateIn) & "/"
Else
tempText = tempText & DatePart("m",dateIn) & "/"
End If

fixTheDate = tempText & DatePart("yyyy",dateIn)

else ' if not a date, send back an empty string

fixTheDate = ""

end if
end function

response.write(fixTheDate(Date()))
%>





(in reply to box)
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: <%=date%> - 2/6/2008 8:31:07   
quote:

the problem is if I use it as hidden value in the form I get syntax error!!!


What specifically is the error and what is the line it errors on?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to box)
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
RE: <%=date%> - 2/6/2008 18:22:37   
Thanks rdouglass for reply here is the error:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/ep/user/pt_update.asp, line 457
function fixTheDate(dateIn)

My form display data form access DB using DRW! even I did try using it as regular text box I got the same error.:)


< Message edited by box -- 2/6/2008 18:31:08 >

(in reply to rdouglass)
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: <%=date%> - 2/6/2008 18:46:37   
You're not putting that whole thing in the textbox value are you? You'd put the function itself at the top of the page and call it where you need to fix that date.

Can you post the code and show me how you're using it? The 10 or 15 lines above and below as well if you please.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to box)
box

 

Posts: 117
Joined: 12/10/2002
Status: offline

 
RE: <%=date%> - 2/7/2008 1:29:20   
Thanks a lot is working great now,

<%response.write(fixTheDate(Date()))%>

< Message edited by box -- 2/7/2008 1:44:14 >

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> <%=date%>
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts