Views:

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 CodeExample OutputDescription
D or d1Displays the day of the month without a leading zero.
DD01Displays the day of the month as two digits with a leading zero.
DDD224Displays the day number within the year.
W or w1Displays the day of the week (Sunday = 1).
WW34Displays the week number within the year.
M or m9Displays the month number without a leading zero.
MM09Displays the month as two digits.
MMM009Displays the month as a three-digit numeric value.
YY or yy91Displays the last two digits of the year.
Y or y1991Displays the four-digit year.
YYY or yyy991Displays the last three digits of the year.
YYYYYYYYY000001991Displays the full year padded with leading zeros.

Common Custom Date Examples

FormatExample Output
MM-DD-YY09-01-24
MM/DD/YYYY09/01/2024
YYYYMMDD20240901
DD-MM-YYYY01-09-2024
mmm-ddddd-yyyyAPR-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.