Class PdfDateFormatter
Serializes dates to/from string as specified by the PDF standard
Inheritance
Namespace: IronSoftware.Pdfium
Assembly: IronPdf.dll
Syntax
public class PdfDateFormatter : Object
Constructors
PdfDateFormatter()
Declaration
public PdfDateFormatter()
Methods
Convert(DateTime)
Convert the specified date into a PDF-compatible local date string with UTC offset information
Declaration
public string Convert(DateTime date)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | date | Date to convert |
Returns
| Type | Description |
|---|---|
| System.String | PDF-compatible local date string |
Convert(String)
Convert the specified PDF-compatible local date string with UTC offset information into a universal DateTime object
Declaration
public DateTime Convert(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | Text to convert |
Returns
| Type | Description |
|---|---|
| System.DateTime | Universal DateTime object |
GetTimeZoneOffset()
Returns the local UTC offset that does not vary with the time of year.
Declaration
public virtual TimeSpan GetTimeZoneOffset()
Returns
| Type | Description |
|---|---|
| System.TimeSpan |
Remarks
This method ignores Daylight Saving Time. Prefer the GetTimeZoneOffset(DateTime) overload, which returns the effective offset for a specific instant and is the method used internally by Convert(DateTime).
GetTimeZoneOffset(DateTime)
Returns the effective local UTC offset for the given date, honoring Daylight Saving Time transitions.
Declaration
public virtual TimeSpan GetTimeZoneOffset(DateTime date)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | date | The instant for which to compute the offset. |
Returns
| Type | Description |
|---|---|
| System.TimeSpan | The effective offset from UTC at |