Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

DoDateTime

LEGEND ,
May 05, 2006 May 05, 2006
Hi All,
Can sombody help me with some date formating please? I have a database with
dates in it. I have a recordset which displays the date as day, date, year
eg 'Saturday, May 06, 2006' using
<%= DoDateTime((events.Fields.Item("StartDate").Value), 1, 1033) %>

I would like to display 'Saturday, 6th May' and lose the year (or at least
just lose the year and display 'Saturday, May 06' if that's easier!)
Is this possible, can anyone help?

Thanks
Ian


TOPICS
Server side applications
638
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 05, 2006 May 05, 2006
There's no built in function or any other argument to do it automatically.
You have to pull each part out separately, and format if necessary.
This should do (making changes for date field):

<%
Dim DateFieldName
Result = WeekDayName( DatePart("w",DateFieldName) ) & ", "
Result = Result & Day(DateFieldName) & " "
Result = Result & MonthName( Month(DateFieldName) )
Response.Write(Result)
%>

Have a look at the Date functions:
http://www.w3schools.com/vbscript/vbscript_ref_functions.asp#date

HTH,
Piers


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 05, 2006 May 05, 2006
LATEST
Thanks, will try soon as i get chance.


"Piers 2k" <fake@msn.com> wrote in message
news:e3frp2$ppk$1@forums.macromedia.com...
> There's no built in function or any other argument to do it automatically.
> You have to pull each part out separately, and format if necessary.
> This should do (making changes for date field):
>
> <%
> Dim DateFieldName
> Result = WeekDayName( DatePart("w",DateFieldName) ) & ", "
> Result = Result & Day(DateFieldName) & " "
> Result = Result & MonthName( Month(DateFieldName) )
> Response.Write(Result)
> %>
>
> Have a look at the Date functions:
> http://www.w3schools.com/vbscript/vbscript_ref_functions.asp#date
>
> HTH,
> Piers
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines