I've worked up an example that procduced the desired result .. it is
_slightly tested_ ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
</head>
<body>
<pre>
You are going to experience problems with this method unless you format your
Date from SQL in an acceptable format ( as presented below ) before it hits
your JS code.
01-24-2006 13:30:00
</pre>
<script>
// this is where you format your date with server side code
// I'm using your hard coded value for now
var someDate= new Date('01-24-2006 13:30:00');
document.write ( '<pre>' + someDate.toString() + '<br />')
with (someDate)
{
document.write ( getHours() % 12 + ':' + getMinutes() +
( parseInt(getHours()) > 12 ? ' PM' : ' AM') + '</pre>')
}
</script>
</body>
</html>
hth,
D.
Scott wrote:
If I have a datetime sql field with afternoon datetime values like below in
DATETIME VALUE, how can I display the time part in ASP as 1:00 PM, instead
of 13:00 PM as seen in CURRENT RESULTS below?
Currently, I'm getting my CURRENT RESULTS by using the HOUR() function. Is
there a way to display just the time part in "non-Military" time format?
DATETIME VALUE:
2006-01-24 13:30:00.000
CURRENT RESULTS::
13:30 PM
DESIRED RESULTS:
1:30 PM