troubleshooting Question

Help with function (ASP/VB Script)

Avatar of Aleks
AleksFlag for United States of America asked on
Web DevelopmentASPVB Script
2 Comments1 Solution361 ViewsLast Modified:
I am using ASP / VB Classic.
The following function will return the date as:  01/01/2013, which is good, but I also need to enter the time along with the date. (Down to seconds)

Can you please provide the necessary code to change it so that it includes time after the date ?


<% function todayStr()
     dim theDate, theDay, theMonth
     theDate = FormatDateTime( now, 2)
     theMonth = Month(theDate)
     if CInt( theMonth ) < 10 then theMonth = "0" & theMonth

     theDay = Day( theDate )
     if CInt( theDay ) < 10 then theDay = "0" & theDay

     todayStr = theMonth & "/" & theDay & "/" & Year(theDate)
end function

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros