![]() |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Zitat:
|
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Und wieviele Funktionen sollen die dafür noch anbieten?
![]() |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Gewusst wo: System.DateUtils.ISO8601ToDate funktioniert!
@Schokohase: Besten Dank! |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Zitat:
Delphi-Quellcode:
oder so ähnlich wäre ganz nett.
StrToDateTime(DateTimeString,DateTimeStringFormatString)
Dann könnte man jedes noch so obskure Format verarbeiten. Gruß K-H |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Zitat:
Bei System.DateUtils.ISO8601ToDate muss ja auch der Parameter AReturnUTC mit 'true' übergeben werden. Dummerweise hat XMLTimeToDateTime 'false' als Vorgabe, im Gegensatz zu ISO8601ToDate. Gruß LP |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Wenn man keine Zeitzonen Information im String hat geht auch folgendes:
Delphi-Quellcode:
var
dt: TDateTime; isoFormatSettings: TFormatSettings; begin isoFormatSettings := TFormatSettings.Create; isoFormatSettings.ShortDateFormat := 'YYYY-MM-DD'; isoFormatSettings.DateSeparator := '-'; isoFormatSettings.TimeSeparator := ':'; isoFormatSettings.DecimalSeparator := '.'; dt := StrToDateTime('2018-06-04T00:00:10', isoFormatSettings); |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:04 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz