the said:
I have stored the datetime value in the database in it's full format.
No you have not. You did not tell us what database you are using, but I can
say with a good degree of certainty that your database is not storing
datetimes with any format. If you are interested in the details of how your
database stores the datetimes, I suggest reading the documentation for your
database.
This is a display problem
Yes, we know. It is up to the client application to apply formatting to
datetimes.
The client just wants the seconds gone.
7:00 PM rather than 7:00:00 PM. I don't see a solution in the prior
information either, sorry.
Umm, forgive me, but you're expected to be able to read and interpret what
was presented. For example, the article I cited contained several examples
of using vbscript to format dates. Like this:
*********************************
YYYYMMDD
(This is the preferred date format for passing dates to a SQL Server
database, as it eliminates the need to worry about regional settings. See
Article #2260 for more information.)
<%
response.write YEAR(Date()) & _
Pd(Month(date()),2) & _
Pd(DAY(date()),2)
%>
**********************************
As you can see, it's simply a matter of using builtin vbscript date
functions (year(), month() and day()) to extract the specific information
from the date and concatenate the bits together in the desired format. A
quick look at the vbscript documentation would have revealed the existence
of similar functions to extract time-related information from a date. I did
not expect to have to spell it out for you, but here you go:
dim d, h, suffix
d=<datetime from database>
h=hour(d)
if h = 0 then
h = 12
suffix = " AM"
elseif h < 13 then
suffix = " AM"
else
suffix = " PM"
h = h - 12
end if
response.write h & ":" & minute(d) & suffix
Bob Barrows