Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
   [Expand]Getting Started
   [Expand]RichEditControl Document
   [Collapse]Fields
    [Expand]Field Codes
    [Collapse]Format Switches
      General Format Switch
      Numeric Format Switch
      Date and Time Format Switch
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    Spell Checking
    AutoCorrect
    Mail Merge
    Restrictions and Protection
    Syntax Highlighting
    Traversing the Document
   [Expand]Visual Elements
    Services
    Events
    Commands
   [Expand]Member Tables
    Keyboard Shortcuts
    HTML Tag Interpretation
   [Expand]Examples
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Date and Time Format Switch

Expanded Syntax

\@ [ " ] switch-argument [ " ]

A date-and-time format switch specifies the format of a date or time result.

Expanded Specifiers

Use "M" for the month, "d" for the Day. For the year, use "yy" or "yyyy". For the Hours, use "h" or "hh" for the hour, "m" or "mm" for the minute, and "am/pm" to include the AM/PM designation. To include other text inside the result, enclose it in single quote marks.

You can combine the following specifiers to construct a format string.

Specifier Description
d Displays the day as a number without a leading zero for single-digit days.
dd Displays the day as a number with a leading zero for single-digit days.
ddd Displays the day of the week in its abbreviated form according to the current culture.
dddd Displays the full name of the day of the week according to the current culture.
M Displays the month as a number without a leading zero for single-digit months.
MM Displays the month as a number with a leading zero for single-digit months.
MMM Displays the month in its abbreviated form according to the current culture.
MMMM Displays the full name of the month according to the current culture.
yy Displays the year number as two digits with a leading zero for years 0 - 9.
yyyy Displays the year number as four digits
h or H Displays the hour as a number without a leading zero for single-digit hours.
hh or HH Displays the hour as a number with a leading zero for single-digit hours.
m Displays the minutes as a number without a leading zero for single-digit minutes.
mm Displays the minutes as a number with a leading zero for single-digit minutes.
am/pm or AM/PM Displays time using am/pm or AM/PM notation.
ss Displays the seconds as a number with a leading zero for single-digit seconds.

Expanded Examples

  • Field code {DATE \@ "'Today is 'MMM. d, yyyy"} results in Today is Dec. 29, 2011
  • Field code {DATE \@ "'Current time is 'HH:mm:ss"} results in Current time is 17:13:15

How would you rate this topic?​​​​​​​