API reference
Class DateTimeFormatAttribute
- Namespace
- DisCatSharp.Common.Serialization
- Assembly
- DisCatSharp.Common.dll
Defines the format for string-serialized DateTime and DateTimeOffset objects.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public sealed class DateTimeFormatAttribute : SerializationAttribute
- Inheritance
-
DateTimeFormatAttribute
- Inherited Members
- Extension Methods
Constructors
- DateTimeFormatAttribute(DateTimeFormatKind)
Specifies a predefined format to use.
- DateTimeFormatAttribute(string)
Specifies a custom format to use.
See https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings for more details.
Fields
- FORMAT_ISO_8601
Gets the ISO 8601 format string of "yyyy-MM-ddTHH:mm:ss.fffzzz".
- FORMAT_LONG
Gets the general long format.
- FORMAT_RFC_1123
Gets the RFC 1123 format string of "R".
- FORMAT_SHORT
Gets the general short format.
Properties
- Format
Gets the custom datetime format string to use.
- Kind
Gets the predefined datetime format kind.