Table of Contents

Enum DateTimeFormatPattern

Namespace
Cuemon
Assembly
Cuemon.Core.dll

Defines the default pattern to use when formatting date- and time values.

public enum DateTimeFormatPattern

Fields

LongDate = 1

Displays a date using the long-date format.

LongDateTime = 5

Displays a date using the long-date format in conjunction with the long-time format.

LongTime = 3

Displays a time using the long-time format.

ShortDate = 0

Displays a date using the short-date format.

ShortDateTime = 4

Displays a date using the short-date format in conjunction with the short-time format.

ShortTime = 2

Displays a time using the short-time format.

Examples

The following example demonstrates how to use DateTimeFormatPattern to select a format pattern for date and time display.

using System;
using Cuemon;

namespace MyApp.Examples;

public class DateTimeFormatPatternExample
{
    public void Demonstrate()
    {
        var shortDate = DateTimeFormatPattern.ShortDate;
        var longDateTime = DateTimeFormatPattern.LongDateTime;

        var now = DateTime.Now;
        Console.WriteLine($"Selected pattern: {shortDate}");
        Console.WriteLine($"Selected pattern: {longDateTime}");

        // Use the pattern with formatting utilities
        // that accept DateTimeFormatPattern to control output.

}
}