Answers
Jun 07, 2007 - 12:28 AM
How did u get the date? Is it today's date?
You could just use the formatting options to return just the date part
otherwise use the Split method and take out the value from subscript 0
Jun 07, 2007 - 12:39 AM
I get date from stored Procedure, and it may be any date
I don't want to change the return format of stored Procedure
how do i use the formatting option please give example
Thank you
Jun 07, 2007 - 12:42 AM
get current date, use DATE() so this returns 6/5/2007
get current time, use TIME() so this returns 11:46:38
get current date/time, use NOW()
in ASP u could also try using FormatDateTime
eg FormatDateTime('6/5/2007 11:46:38',2)
the 2nd parameter 2 means to return the short date format i.e. 6/5/2007
How to use Split
Dim sStr
sStr = Split('6/5/2007 11:46:38 AM',' ')
Response.Write sStr(0) 'returns 6/5/207
Jun 07, 2007 - 12:43 AM
Ok, if stored procedure returning string, see if it works in FormatDateTime or try Split
Jun 07, 2007 - 01:44 AM
Thanks for your cooperation
But available format does not contain the am pm format
so for this need to write funtion?
can we do addition or subtraction between time variable(dim t)?
Jun 07, 2007 - 02:57 AM
do u want
'6/5/2007 AM
Sep 27, 2007 - 01:20 AM
response.write(FormatDateTime(date(),vbgeneraldate)) /// for date 9/27/2007
response.write(FormatDateTime(now(),vbshorttime)) /// for time 02:50 AM
Add New Comment