[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.PdfDateTime

Struct PdfDateTime

Namespace
GrapeCity.Documents.Pdf
Assembly
GcDocs.Pdf.dll

Represents a PDF DateTime type.

public struct PdfDateTime : IEquatable<PdfDateTime>
Implements
System.IEquatable<T><PdfDateTime>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

Constructors

PdfDateTime(IPdfString)

Initializes a new instance of the PdfDateTime struct using a IPdfString. The passed string is converted to System.DateTimeOffset if possible.

public PdfDateTime(IPdfString value)

Parameters

value IPdfString

The IPdfString representing a date time value.

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

PdfDateTime(DateTime)

Initializes a new instance of the PdfDateTime struct using a System.DateTime value.

public PdfDateTime(DateTime value)

Parameters

value System.DateTime

The System.DateTime value.

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

PdfDateTime(string)

Initializes a new instance of the PdfDateTime struct using a string. The passed string is converted to System.DateTimeOffset if possible.

public PdfDateTime(string value)

Parameters

value string

The string representing a date time value.

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

Properties

DateTimeOffset

Gets the System.DateTimeOffset value defined by this PdfDateTime. Throws an exception if this PdfDateTime is represented by an unparsed string.

public DateTimeOffset DateTimeOffset { get; }

Property Value

System.DateTimeOffset

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

DateTimeValue

Gets the System.DateTime value representing local time. Throws an exception if this PdfDateTime is represented by an unparsed string.

public DateTime DateTimeValue { get; }

Property Value

System.DateTime

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

IsString

Gets a value indicating whether this PdfDateTime struct contains a string value which cannot be converted to System.DateTime.

public bool IsString { get; }

Property Value

bool

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

Value

Gets the IPdfString representing the value of this PdfDateTime.

public IPdfString Value { get; }

Property Value

IPdfString

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

Methods

DateTimeToPdfString(DateTime)

Converts a System.DateTime value to a string in PDF format as described in PDF 1.7 specification chapter 3.8.3.

public static string DateTimeToPdfString(DateTime value)

Parameters

value System.DateTime

The System.DateTime value.

Returns

string

Returns string with formatted datetime.

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

DateTimeToPdfString(DateTimeOffset)

Converts a System.DateTimeOffset value to a string in PDF format as described in PDF 1.7 specification chapter 3.8.3.

public static string DateTimeToPdfString(DateTimeOffset value)

Parameters

value System.DateTimeOffset

The System.DateTime value.

Returns

string

Returns string with formatted datetime.

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

Equals(PdfDateTime)

Checks whether this PdfDateTime is equal to another PdfDateTime.

public bool Equals(PdfDateTime other)

Parameters

other PdfDateTime

The PdfDateTime value to compare to.

Returns

bool

True if values are equal, false otherwise.

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

GetHashCode()

public override int GetHashCode()

Returns

int

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

ToString()

public override string ToString()

Returns

string

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

ToString(string)

Converts this PdfDateTime to string, using a specified format if the current struct holds a DateTime value.

public string ToString(string dateTimeFormat)

Parameters

dateTimeFormat string

The date time format.

Returns

string

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

TryParse(string, out DateTimeOffset)

Tries to convert a string to System.DateTimeOffset. See PDF 1.7 specification chapter 3.8.3.

public static bool TryParse(string s, out DateTimeOffset value)

Parameters

s string

The string in the format D:YYYYMMDDHHmmSSOHH'mm'.

value System.DateTimeOffset

OUT: The parsed System.DateTimeOffset value.

Returns

bool

True if conversion succeed, false otherwise.

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

Operators

operator ==(PdfDateTime, PdfDateTime)

The equality operator.

public static bool operator ==(PdfDateTime v1, PdfDateTime v2)

Parameters

v1 PdfDateTime
v2 PdfDateTime

Returns

bool

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

implicit operator PdfDateTime(DateTime)

Converts a System.DateTime value to PdfDateTime.

public static implicit operator PdfDateTime(DateTime value)

Parameters

value System.DateTime

Returns

PdfDateTime

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.

operator !=(PdfDateTime, PdfDateTime)

The inequality operator.

public static bool operator !=(PdfDateTime v1, PdfDateTime v2)

Parameters

v1 PdfDateTime
v2 PdfDateTime

Returns

bool

Remarks

The PDF Specification does not define a special type for DateTime values, such values are stored as strings in a special format, similar to (D:YYYYMMDDHHmmSSOHH'mm'), see the spec for details (PDF 1.7 chapter 3.8.3).

But there are many PDF documents in which DateTime strings are specified in some custom format, for example using a regional format. GcPdf uses this struct when processing such values. Where possible, the value is converted to System.DateTimeOffset, otherwise it preserves the original string value.