PDA

View Full Version : Date & Time ASP VB



sladmin
15-05-2008, 12:36 AM
Hi,

I want to put the time into a hidden field to use for my helpdesk. However I can't seem to find a proper time variable that will display the time how I want it. I want to display the time like this: 1:30 PM. I've tried loads of website and scripts but they either don't work or they display without the 'PM' bit :blink:

Here's the code:


<% response.write(FormatDateTime(now(),vblongtime))%>Any ideas??

Thanks in advance :smilie:

siphilp
15-05-2008, 07:19 AM
can't recall a function that would put a pm on to a date/time. :glare:

You could always convert it to 24 hour if it's =>13 them Pm else AM? Just display the normal time?

Haven't touched ASP for years. Am sure Mark will know?

Mark Voss
15-05-2008, 04:25 PM
Simon's right - there isn't a function that'll do this for you - you'll have to write your own!

There's a good tutorial you can get the necessary code from here (http://www.ronshardwebapps.com/tips/jantutorialtimedate.asp)