Dr
Wed Jun 07 17:00:22 CDT 2006
JRS: In article <ebYnKsjiGHA.5088@TK2MSFTNGP02.phx.gbl>, dated Wed, 7
Jun 2006 10:02:38 remote, seen in news:microsoft.public.scripting.vbscri
pt, Ray Costanzo [MVP] <my@first.name> posted :
>Dim t
>t = #1/1/2006 02:18:35 PM#
>Response.Write p(Hour(t)) & ":" & p(Minute(t)) & ":" & p(Second(t))
>
>Function p(i)
> p = Right("00" & CStr(i), 2)
>End Function
>
>
>The "p" function is just meant to pad single digits with zeros, so that if
>it's 1:05 PM, you get that 0 in front of the 5 when building the string.
>Rename the function to something of your choice, or just eliminate it and
>pad inline.
ISTM that an explicit CStr is not needed, that only "0" need be
concatenated, and that Right(100+i, 2) may be faster.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:
http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:
http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.