![]() |
Delphi-Version: 10.2 Tokyo
StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Hallo,
wie wandle ich den String '2018-06-04T00:00:10' in ein Datum um? dt := StrToDateTime('2018-06-04T00:00:10'); funktioniert nicht, ungültiges Format. zum Vergleich: in C# reicht var dt = Convert.ToDateTime("2018-06-04T00:00:10"); Besten Dank und Gruß |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
|
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Nein, funktioniert nicht.
Man beachte das 'T' im String. |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
|
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Zitat:
Dann ist die Lösung von @Maekkelrajter wohl die nächste. gruss |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Super, XMLTimeToDateTime funktioniert.
Soap.XSBuiltIns unter uses hinzugefügt und klappt. Der String '2018-06-04T00:00:10' kommt tatsächlich aus einem REST/Json-WebAPI. Interessant, dass man hier eine Routine aus Soap verwenden kann. Anyway, besten Dank! |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
...ich sehe gerade:
aus '2018-06-04T00:00:10' wird 04.06.2018 02:00:10 (TDateTime) Zeitzone? Sommerzeit? GMT? Ist schon spannend... Gruß |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Zitat:
![]() |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Da hat man ausnahmsweise mal eines der am besten dokumentierten und strukturierten Datums / Zeitformate, das es gibt, und die Standard-Funktion von Delphi kann es nicht interpretieren.
Es lebe das amerikanische Format: 09/11/01 8:46 am Bisher ist mir noch nichts schlimmeres in der Praxis untergekommen. |
AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
@dummzeuch:
Exakt, sehe ich genauso... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:44 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 by Thomas Breitkreuz