This article describes how to use the RFC 1123 R or r Format Specifier in LightSwitch Visual Studio 2012. The R or r format specifier is a format specifier for the RFC 1123 date and time format standard to represent a custom date and time format string defined by the DateTimeFormatInfo.RFC1123 pattern property.
This article describes how to use the RFC 1123 "R" or "r" Format Specifier in LightSwitch Visual Studio 2012. The "R" or "r" format specifier is a format specifier for the RFC 1123 date and time format standard to represent a custom date and time format string defined by the DateTimeFormatInfo.RFC1123 pattern property. It reflects a defined standard and the property is readonly. The custom format string is "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'". Although it expresses the time as a Universal Time Coordinate (UTC) time, the formatting operation does not modify the value of a DateTime or DateTimeOffset object, in other words being formatted. Therefore, it is necessary to convert the date and time value to UTC before it performs the formatting operation. Use the following procedure to create a sample showing how to use the RFC 1123 "R" or "r" Format Specifier on a Screen. Step 1 Open the LightSwitch Application in Visual Studio 2012 and go to the Solution Explorer. Right-click on "Data Sources" and choose "Add Table". The table appears in the Table Designer window. Insert the records in the following table. Step 2 Now once again go to the Solution Explorer, right-click on Screens and choose "Add Screen". The Add New Screen dialog box appears. Select the "Editable Grid Screen" from the Screen Template, inside screen information, choose "Employee" under screen data and provide some name to the Screen and click the "OK" button. The Screen Designer appears as shown below. Step 3 Press F5 to run the application. Provide the information. Step 4 Now stop debugging the application. From the Table Designer select the "DOJ" record as shown in the figure below. Then go to the Format Pattern of Property window in the Table Designer and enter "R" in the format pattern as shown below. Or you can enter enter "r" in the format pattern as shown below. Once again press F5 to run the application. This time we will get the following output.
Printing in C# Made Easy