Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FormatDateTime issue

Status
Not open for further replies.

kenhutchings

Programmer
Joined
Jan 11, 2005
Messages
32
Location
GB
I hope someone out there can help me...

Im using FormatDateTime(Now,vbLongDate) and I expected to get:

Tuesday 11 January 2005
but what i actually get is:

11 January 2005

any ideas??

Thanks in advance ;0)
 
you need to do some manipulation to get the desired output...

use the below three functions and concatenate them

day(yourdatefield) ---- 11
MonthName(Month(yourdatefield))----January
Year(yourdatefield)---- 2005

-L
 
or if you want today's date...use the date() function..

day(date()) ---- 11
MonthName(Month(date()))----January
Year(date())---- 2005

so concatenate them...

<%=day(date())%>&""&<%=MonthName(Month(date()))%>&""&<%=Year(date())%>

-L





 
That still gives me the output i had before

I would like to get the day on there as well eg: Tuesday

Many thanks tho

;0)
 
oops..my fault...

you were missing parenthesis...

this shud do it

FormatDateTime(Now(),vbLongDate)

-L
 
if that still doesnt work...then try...

<%=dayname(day(date()))%>&""&<%=day(date())%>&""&<%=MonthName(Month(date()))%>&""&<%=Year(date())%>

-L
 
if that still doesnt work...then try...

<%=dayname(day(date())%>&""&<%=day(date())%>&""&<%=MonthName(Month(date()))%>&""&<%=Year(date())%>

-L
 
Thanks a lot Lothario but what I ended up using was
<%=weekdayname(weekday(date()))%>&nbsp;<%=day(date())%>&nbsp;<%=MonthName(Month(date()))%>&nbsp;<%=Year(date())%>

Without your help id have never got there

;0)
 
no problem...i am glad that it worked for you...

-L
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top