Format Date to Iso c

sanjshah12
sanjshah12 used Ask the Experts™
on
Hi,

I have 2 fields in my DB that are required to be formatted to JS iso c format, i.e.

Mon Jun 11 2012 10:00:00 GMT+0100 (GMT Daylight Time)

the fields in my DB are set to 21/10/2012 and 10:00

is there an easy way to format this to the required format?

I can do the right hand part by concatenation :

StartTime & ":00 GMT+0100 (GMT Daylight Time)"

but struggling with the left hand part.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
Commented:
<%
dim theDate
theDate =rs.datetime

dayname=      WeekdayName(datepart("d",theDate),true)
monthname= monthname(datepart("m",theDate),true)
weekday=       datepart("d",theDate)
year=              year(theDate)
time=             formatdatetime(theDate,4)            

StartTime = dayname&" "&monthname&" "&weekday&" "&year& " "&time&"":00 GMT+0100 (GMT Daylight Time)"

%>

Author

Commented:
Thanks Padas,

But I receive an error:

Invalid procedure call or argument: 'WeekdayName'

Any ideas?
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
oops, that should be

dayname =WeekdayName(Weekday(theDate),true)

Author

Commented:
Thanks padas, that worked perfectly!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial