Click here to Skip to main content
15,922,407 members
Home / Discussions / C#
   

C#

 
QuestionCultureInfo and DateTime.parse Pin
Paul E Davies11-Feb-11 3:59
Paul E Davies11-Feb-11 3:59 
AnswerRe: CultureInfo and DateTime.parse Pin
OriginalGriff11-Feb-11 4:48
mveOriginalGriff11-Feb-11 4:48 
GeneralRe: CultureInfo and DateTime.parse Pin
Paul E Davies13-Feb-11 22:24
Paul E Davies13-Feb-11 22:24 
GeneralRe: CultureInfo and DateTime.parse Pin
OriginalGriff13-Feb-11 22:41
mveOriginalGriff13-Feb-11 22:41 
GeneralRe: CultureInfo and DateTime.parse Pin
Paul E Davies13-Feb-11 23:24
Paul E Davies13-Feb-11 23:24 
GeneralRe: CultureInfo and DateTime.parse Pin
OriginalGriff14-Feb-11 1:36
mveOriginalGriff14-Feb-11 1:36 
GeneralRe: CultureInfo and DateTime.parse Pin
Paul E Davies14-Feb-11 4:26
Paul E Davies14-Feb-11 4:26 
GeneralRe: CultureInfo and DateTime.parse Pin
OriginalGriff14-Feb-11 9:04
mveOriginalGriff14-Feb-11 9:04 
I don't normally use SOAP - I try to avoid serialization - but I thought it used ISO 8601?

So I thought I'd take a quick look with a SoapFormatter:
public static void ToSoap(Object objToSoap, string filePath)
    {
    IFormatter formatter;
    FileStream fileStream = null;
    using (fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
        {
        formatter = new SoapFormatter();
        formatter.Serialize(fileStream, objToSoap);
        }
    }

Serializing a DateTime gave a SOAP containing Tick information:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <xsd:dateTime id="ref-1">
         <ticks>634333105156406250</ticks>
         <dateData>9857705142011182058</dateData>
      </xsd:dateTime>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Serializing a class containing a DateTime gave ISO8601 data:
demo d = new demo();
d.s = "Hello Paul";
d.d = DateTime.Now;
ToSoap(d, @"F:\Temp\datetime.soap");

[Serializable]
public class demo
    {
    public string s;
    public DateTime d;
    }

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <a1:Program_x002B_demo id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/ConsoleApplication1/Tester%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
         <s id="ref-3">Hello Paul</s>
         <d>2011-02-14T19:54:57.4218750+00:00</d>
      </a1:Program_x002B_demo>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


I know it's not helpful to you, but I'm intrigued now: how are you doing it?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."

GeneralRe: CultureInfo and DateTime.parse Pin
Paul E Davies14-Feb-11 21:51
Paul E Davies14-Feb-11 21:51 
Questionsound on btn clik Pin
aeman11-Feb-11 2:28
aeman11-Feb-11 2:28 
AnswerRe: sound on btn clik Pin
OriginalGriff11-Feb-11 2:41
mveOriginalGriff11-Feb-11 2:41 
GeneralRe: sound on btn clik Pin
aeman11-Feb-11 4:06
aeman11-Feb-11 4:06 
AnswerRe: sound on btn clik Pin
OriginalGriff11-Feb-11 4:41
mveOriginalGriff11-Feb-11 4:41 
GeneralRe: sound on btn clik Pin
aeman11-Feb-11 5:53
aeman11-Feb-11 5:53 
AnswerRe: sound on btn clik Pin
OriginalGriff11-Feb-11 8:50
mveOriginalGriff11-Feb-11 8:50 
GeneralRe: sound on btn clik Pin
aeman11-Feb-11 21:26
aeman11-Feb-11 21:26 
GeneralRe: sound on btn clik Pin
OriginalGriff11-Feb-11 21:31
mveOriginalGriff11-Feb-11 21:31 
GeneralRe: sound on btn clik Pin
aeman11-Feb-11 22:15
aeman11-Feb-11 22:15 
GeneralRe: sound on btn clik Pin
OriginalGriff11-Feb-11 22:21
mveOriginalGriff11-Feb-11 22:21 
GeneralRe: sound on btn clik Pin
aeman12-Feb-11 5:25
aeman12-Feb-11 5:25 
AnswerRe: sound on btn clik Pin
musefan11-Feb-11 2:47
musefan11-Feb-11 2:47 
AnswerRe: sound on btn clik Pin
DaveyM6911-Feb-11 3:17
professionalDaveyM6911-Feb-11 3:17 
QuestionRTP to streaming webcam P2P or to a webpage [modified] Pin
Honik8911-Feb-11 2:16
Honik8911-Feb-11 2:16 
AnswerRe: RTP to streaming webcam P2P or to a webpage Pin
Ali Al Omairi(Abu AlHassan)11-Feb-11 15:16
professionalAli Al Omairi(Abu AlHassan)11-Feb-11 15:16 
GeneralRe: RTP to streaming webcam P2P or to a webpage Pin
Honik8911-Feb-11 22:13
Honik8911-Feb-11 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.