This article describes the difference between the Short Date("d") and Long Date("D") Format Specifiers in LightSwitch Visual Studio 2012.Short Date ("d") Format SpecifierThe "d" standard format specifier is used to represent a custom date and time format string defined by the DateTimeFormatInfo.ShortDatePattern property. The custom format string for the Short Date Format Specifier is "MM/dd/yyyy".Long Date("D") Format SpecifierThe "D" standard format specifier represents a custom date and time format string defined by the DateTimeFormatInfo.ShortDatePattern property. The custom format string for the Short Date Format Specifier is "dddd , dd MMMM yyyy".Use the following procedure to create a sample showing how to use the Short Date("d") and Long Date("D") Format Specifiers on a Screen.Step 1Open 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 2Now 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 the 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.Press F5 to run the application. Provide the information; we will get the following output. Step 3Now 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 the Property window in the Table Designer and enter "d" in the format pattern for the Short Date Format Specifier as shown below.Once again press F5 to run the application. This time we will get the following output.Step 4Once again stop debugging the application and select the "DOJ" record from the table.Now go to the Format Pattern of the Property window in the Table Designer and this time enter "D" in the format pattern for Long Date Format Specifier as shown below.Once again press F5 to run the application. This time we will get the following output.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: