Guest haoli12345 Posted June 13, 2002 Posted June 13, 2002 I want to format my date like 2002/06/13 I dont know how to do it in ASP but I know how to do it in Visual Basic Format(Date, "YYYY/MM/DD") is there a way to do this in ASP. I would also like to format my time in 24 hours mode like this 15:06:32 if you know please reply. Thank You. -Hao Li- Quote
Guest Tony555 Posted June 20, 2002 Posted June 20, 2002 formatdatetime("June 13, 2002",DateFormat.ShortDate) returns 6/13/2002, don't know how to display 2002/06/13, maybe you can not Quote
shadowskull Posted June 27, 2002 Posted June 27, 2002 Idea Here's what we have done at my work..... If txtDate.Text <> "" Then Dim dtdate As Date Dim sDate As String sDate = txtDate.Text dtdate = CDate(stDate) txtDate.Text = CStr(Format(dtdate, "MM/dd/yyyy")) End If Basically, if you're obtaining the date as a text field, you should then convert it into date, then back into text field with the format. We don't convert it back to Date field after that, we just stick it into a text box for display to the user. Quote
*Gurus* Derek Stone Posted June 27, 2002 *Gurus* Posted June 27, 2002 sTime = Hour(Now) + 1 & ":" & Minute(Now) & ":" & Second(Now) Good Luck -CL Quote Posting Guidelines
*Gurus* Thinker Posted June 28, 2002 *Gurus* Posted June 28, 2002 Is this really ASP.NET, or just ASP? Quote Posting Guidelines
shadowskull Posted June 28, 2002 Posted June 28, 2002 Thinker, I don't know as to whom that question was anchored toward, but at my work, it's all .Net (ASP.Net, VB.Net, C#.Net, etc.) and it's all Web App Development, if that answers your question. My apologies if it doesn't. Quote
*Gurus* Thinker Posted June 28, 2002 *Gurus* Posted June 28, 2002 I was directing the question to the original poster, sorry for the confusion. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.