function DecodeDate(const Value: string; out DateTime: TDateTime; out DateTimeOffset: Integer): Boolean;
| Value | string. PDF date string in the PDF date format: D:YYYYMMDDHHmmSSOHH'mm' (e.g. "D:20240515120000+08'00'"). |
| DateTime | TDateTime. Output parameter that receives the decoded date and time value. |
| DateTimeOffset | Integer. Çıktı parametresi, UTC konumunu dakika cinsinden alır. Pozitif değerler UTC'nin doğusunu, negatif değerler batısını gösterir |
True if Value was successfully parsed as a valid PDF date string. Döndürür: False dize boşsa, bozuksa ya da PDF tarih biçimine uymuyorsa.DecodeDate, PDFium unit'inde unit düzeyinde bir global fonksiyondur. Bir PDF tarih stringini ayrıştırır ve UTC saat dilimi konumuyla (dakika cinsinden) birlikte bir Delphi TDateTime değerine çevirir
PDF dokümanları tarihleri D:YYYYMMDDHHmmSSOHH'mm' biçiminde saklar; burada O UTC ile ilişkiyi gösterir (+, - veya Z). CreationDate ve ModifiedDate gibi property'lerin döndürdüğü ham stringleri çözmek için bu fonksiyonu kullanın
DateTimeOffset out parametresi işaretli UTC konumunu dakika cinsinden içerir (örneğin UTC+8 için 480, UTC-5 için -300). DateTime out parametresi, PDF stringinde kodlandığı hâliyle yerel saate ayarlanır; UTC'ye çevrilmez
var
DT: TDateTime;
Offset: Integer;
begin
if DecodeDate(Pdf.CreationDate, DT, Offset) then
begin
ShowMessage('Created: ' + DateTimeToStr(DT));
ShowMessage('UTC offset (minutes): ' + IntToStr(Offset));
end;
end;