Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   XML (https://www.delphipraxis.net/46-xml/)
-   -   Delphi MSXML: wie Datumsformat festlegen ? (https://www.delphipraxis.net/81679-msxml-wie-datumsformat-festlegen.html)

shmia 1. Dez 2006 14:06


MSXML: wie Datumsformat festlegen ?
 
Ich schreibe wie folgt eine XML-Datei:
Delphi-Quellcode:
   document := CoDOMDocument30.Create;
   document.appendChild(document.createProcessingInstruction('xml', 'version="1.0" encoding="UTF-8" standalone="yes"'));

   // Wurzelknoten
   xmlElementData := document.createElement('DATA');
   xmlElementData.setAttribute('DateTime', Now);
   document.appendChild(xmlElementPssData);
   document.save('C:\test.xml);
und erhalte folgende Datei:
XML-Code:
 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
  <DATA DateTime="12/1/2006 3:02:52 PM" />
Ich möchte nun gerne das Datumsformat ISO-8601 anstelle der amerikanischen Datumsschreibweise benützen.
Wie kann dies erreicht werden, ohne das ich das Datum vorher in einen String umwandle?


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:49 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