Product: LABELVIEW, CODESOFT
Version: All Versions
Create a Custom Date Format
This article explains how to create and use a custom date format in LABELVIEW and CODESOFT. Custom date formats are configured through a Date data source and can be used to display dates in formats that are not included in the predefined options.
Important: A Date data source must be created before a custom date format can be configured.
Add a Date Field
Step 1: Open Data Sources, locate Date, and click Add.
Step 2: The Date configuration window opens. Several predefined date formats are available.
Step 3: Scroll to the bottom of the Date Format list and select Customized.
Date Format Codes
| Date Code | Example Output | Description |
|---|---|---|
| D or d | 1 | Displays the day of the month without a leading zero. |
| DD | 01 | Displays the day of the month as two digits with a leading zero. |
| DDD | 224 | Displays the day number within the year. |
| W or w | 1 | Displays the day of the week (Sunday = 1). |
| WW | 34 | Displays the week number within the year. |
| M or m | 9 | Displays the month number without a leading zero. |
| MM | 09 | Displays the month as two digits. |
| MMM | 009 | Displays the month as a three-digit numeric value. |
| YY or yy | 91 | Displays the last two digits of the year. |
| Y or y | 1991 | Displays the four-digit year. |
| YYY or yyy | 991 | Displays the last three digits of the year. |
| YYYYYYYYY | 000001991 | Displays the full year padded with leading zeros. |
Common Custom Date Examples
| Format | Example Output |
|---|---|
| MM-DD-YY | 09-01-24 |
| MM/DD/YYYY | 09/01/2024 |
| YYYYMMDD | 20240901 |
| DD-MM-YYYY | 01-09-2024 |
| mmm-ddddd-yyyy | APR-Monday-2020 |
Software Date vs. Printer Date
Recommendation: Use TEKLYNX internal drivers whenever possible when working with advanced date formats. Printer firmware supports a limited set of date formatting options compared to software-based date processing.
Printer-based date formats may not support every format available through software-based date processing.
To view printer-supported formats, change:
- Date Type: Software Date
to:
- Date Type: Printer Date
The available formats shown will be limited to those supported by the selected printer.
Key Points
- Create a Date data source before configuring a custom date format.
- Select Customized from the Date Format list to create your own format.
- Use the date format codes shown above to build the desired output.
- Software Date provides the greatest flexibility for custom date formats.
- Printer Date formats are limited by the capabilities of the selected printer and printer firmware.
