How to Format a Date From a Recordset in Dreamweaver
Adobe Dreamweaver allows you to pull data from a variety of data sources, including flat files and databases, and display it on your website. Most developers using this software use it with Adobe's tightly integrated ColdFusion application. When pulling date information, you can change the date format using the LSDateFormat command. The LSDateFormat command takes a date/time object that can range from 100-9999 AD, a mask, indicating the desired display format and an optional locale parameter.
Instructions
-
-
1
Add the output tag to your webpage in Dreamweaver using the <cfoutput></cfoutput> tag.
-
2
Type "#LSDateFormat()#" between the output tags. The function name is not case sensitive. You must include the pound/hash signs.
-
-
3
Type the name of the field containing your date after the opening parenthesis. Your code segment should look like this:
<cfoutput>#LSDateFormat(mydate)#</cfoutput>
-
4
Type a comma after the date, followed by the desired date format. Using "short" as a mask will get the date in a dd/mm/yy format; medium returns the month abbreviation, followed by a one or two-digit date and the four-digit year; "long" is the same as medium, but returns the full month name. There are many other options available, which are listed at help.adobe.com.
-
5
Type the locale you wish to use if you don't want to use the default for the page. The page uses standard Java locale rules.
-
1
Tips & Warnings
You can list all of the supported locales using a loop and outputting the #server.Coldfusion.SupportedLocales# list.