This routine illustrates how to create a formatted date string that includes the day of the week, month, day, and year (e.g., Friday April 14, 2006).
How It Works
The formatted date is computed with a combination of the @Today, @Weekday, @Year, @Month, and @Day functions. The returned values are subsequently used to create the formatted date string, which is stored in the theDate variable.
To implement this solution, insert the following formula in an action button, column, or default value for a field. Optionally, replace @Today with a date or field. The @Prompt statement is used for illustrative purposes and can be removed or updated as desired. However, if removed, be sure the formula contains a main expression (i.e., Result) as the last statement in the formula.
theDate := @Today; theWeekday := @Select(@Weekday (theDate); "Sunday"; "Monday"; "Tuesday"; "Wednesday"; "Thursday"; "Friday"; "Saturday" ); theMonth := @Select(@Month(theDate); "January"; "February"; "March"; "April"; "May"; "June"; "July"; "August"; "September"; "October"; "November"; "December" ); theDay := @Text (@Day (@Today)); theYear := @Text (@Year (theDate)); result := "Today is " + theWeekday + " " + theMonth + " " + theDay + ", " + theYear; @Prompt([Ok];"Result"; result);
Figure 14.5 depicts the result when implemented in an action button.
Figure 14.5. Example of a formatted date string
An Introduction to the Lotus Domino Tool Suite
Getting Started with Designer
Navigating the Domino Designer Workspace
Domino Design Elements
An Introduction to Formula Language
An Introduction to LotusScript
Fundamentals of a Notes Application
Reference Library Applications
Design Enhancements Using LotusScript
Design Enhancements Using Formula Language
Miscellaneous Enhancements and Tips for Domino Databases
Application Deployment and Maintenance
Appendix A. Online Project Files and Sample Applications
Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?