|
-
Oct 30th, 2002, 08:22 AM
#1
VBScript - format time
is there a way to format the time so that it does not show seconds... i am using the formatdatetime() function... but it displays seconds in it... you can't customize the format like you can with the VB format() function
-
Oct 30th, 2002, 09:53 AM
#2
Lively Member
i found this article which i think will be really helpfull
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=48
good luck
-
Oct 30th, 2002, 09:57 AM
#3
that has nothing to do with formatting the date/time though
-
Oct 30th, 2002, 10:05 AM
#4
Code:
dim todaysDate
todaysDate = now()
Response.write FormatDateTime(todaysDate,4)
-
Oct 30th, 2002, 10:06 AM
#5
Originally posted by kleinma
that has nothing to do with formatting the date/time though
ROFL.
-
Oct 30th, 2002, 10:08 AM
#6
Lively Member
sorry, guess i'm not really awake yet
-
Oct 30th, 2002, 10:34 AM
#7
Originally posted by mendhak
Code:
dim todaysDate
todaysDate = now()
Response.write FormatDateTime(todaysDate,4)
i want to preserve the AM PM 12 hour clock though... formatting it using 4 gives you military time..
-
Oct 30th, 2002, 01:21 PM
#8
Originally posted by kleinma
i want to preserve the AM PM 12 hour clock though... formatting it using 4 gives you military time... Do it you stupid frog! I'll give you a big fat joint if you do it!!
Picky, picky picky. 
Code:
dim todaysDate
todaysDate = now()
Response.write FormatDateTime(todaysDate,4)
Response.Write "<BR>"
dim abc, def, ghi
abc = cstr(FormatDateTime(todaysDate,4))
def = mid(abc,1,instr(1,abc,":")-1)
ghi = cint(def)
if ghi > 12 then
ghi = ghi - 12
abc = replace(abc,def,cstr(ghi)) & " PM"
else
abc = abc & " AM"
end if
Response.Write "<BR><BR>" & abc
%>
-
Oct 30th, 2002, 11:49 PM
#9
Lively Member
how to show date n time in asp form that it will auto update the time every second without refreshing the form?
can show code?
-
Oct 31st, 2002, 01:59 AM
#10
Originally posted by hongge
how to show date n time in asp form that it will auto update the time every second without refreshing the form?
can show code?
You could use javascript for that.
-
Nov 17th, 2016, 10:50 PM
#11
New Member
Re: VBScript - format time
I realize I'm probably beating a dead horse here, but..
Code:
Dim crntTime
crntTime = Left(Time,5) & Right(Time,3)
Which will output hh:mm tt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|