Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Actually i make report in xml file using this code...
when report run data and time appeard in this format... the date like this
2001-10-26T19:32:52+00:00,,,,,2001-10-26T21:32:52+02:00,,,, while Time like this
PT17H41M40S..... i need correct standerd format for date and time how it will be correct if any one has some idea plzzz help me...

C#
string xmlPath = Environment.CurrentDirectory.Substring(0, Environment.CurrentDirectory.IndexOf("bin")) + "NewFolder1\\BatchTimeTableRpt.XML"; ;
string xslPath = Environment.CurrentDirectory.Substring(0, Environment.CurrentDirectory.IndexOf("bin")) + "NewFolder1\\BatchTimeTableRpt.XSL"; ;
string resultPath = Environment.CurrentDirectory.Substring(0, Environment.CurrentDirectory.IndexOf("bin")) + "NewFolder1\\MyHtml.html"; ;
dt.WriteXml(xmlPath);
//XmlReader loads XML file
XmlReader reader = XmlReader.Create(xmlPath);
//XmlTextWriter creats output file
XmlTextWriter writer = new XmlTextWriter(resultPath, null);
//XslCompiledTransform loads XSLT file
XslCompiledTransform xsl = new XslCompiledTransform();
xsl.Load(xslPath);
xsl.Transform(reader, null, writer);
//  html =result.Document.ToString();
System.Diagnostics.Process PROC = new System.Diagnostics.Process();
PROC.StartInfo = new System.Diagnostics.ProcessStartInfo(resultPath);
PROC.Start();
Posted
Updated 7-Nov-14 7:20am
v3
Comments
PIEBALDconsult 7-Nov-14 11:03am    
Those are correct. Read up on ISO 8601.
http://www.w3schools.com/schema/schema_dtypes_date.asp

Perhaps you mean you want to use the _wrong_ format.

1 solution

Um.
That is a "correct standerd format for date and time" - it's a UCT value: http://www.w3.org/TR/NOTE-datetime[^] and it is exactly what you want in a xml file that can be accessed in multiple countries as it specifies the time absolutley rather than by an implied reference to a local time zone.

I'd leave it alone: xml files aren't supposed to be read by "normal human beings"! :laugh:
 
Share this answer
 
Comments
PIEBALDconsult 7-Nov-14 11:10am    
Oooh, that's a better link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900