AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi StrToDateTime('2018-06-04T00:00:10'); ungültiges Format
Thema durchsuchen
Ansicht
Themen-Optionen

StrToDateTime('2018-06-04T00:00:10'); ungültiges Format

Ein Thema von Friedhelm Drecktrah · begonnen am 11. Jun 2019 · letzter Beitrag vom 13. Jun 2019
Antwort Antwort
Benutzerbild von Stevie
Stevie

Registriert seit: 12. Aug 2003
Ort: Soest
4.046 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#1

AW: StrToDateTime('2018-06-04T00:00:10'); ungültiges Format

  Alt 13. Jun 2019, 11:54
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);
Stefan
“Simplicity, carried to the extreme, becomes elegance.” Jon Franklin

Delphi Sorcery - DSharp - Spring4D - TestInsight

Geändert von Stevie (13. Jun 2019 um 12:00 Uhr)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:24 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