date format

Mar 19, 2009 at 1:26 PM
Hi,
I'm passing a datetime value from as3 to dotnetflex and using the GetDate function to return it - however it comes through as a completely random date conpared to the input. I can test that the date I'm inserting is correct and it doesn't complain that it is is the wrong type. Could it be a localisation issue - i'm based in the uk? please help :)

Thanks.
Josh
Mar 19, 2009 at 2:26 PM
well your keeping me on my toes - it's good though for me to understand how the code is working... anyway I found the problem
in AMFReader.cs you've set _groundZero to '2/2/1970' when it should be '1/1/1970' so it's was throwing all the dates off.

 

private DateTime _groundZero = DateTime.Parse("1/1/1970", null, System.Globalization.DateTimeStyles.AssumeUniversal & System.Globalization.DateTimeStyles.AdjustToUniversal);

thanks again for the great code :)

Josh

 

Coordinator
Mar 19, 2009 at 8:44 PM

Sorry for the hassle, I should have put some examples up about how to handle dates.  I create a special data type for dates that you can use to get the exact date entered on the client (as the client sees it), the converted date in server time, and the GMT version of the date in absolute terms.  This has been working on my side but I will still re-check the code – I don’t see a 2/2/1970 on my side anywhere so I’m sure I messed something up in there. 

Thanks and continued success!

From: moonty [mailto:notifications@codeplex.com]
Sent: Thursday, March 19, 2009 7:26 AM
To: steve.klee@yahoo.com
Subject: Re: date format [dotnetflex:50641]

From: moonty

well your keeping me on my toes - it's good though for me to understand how the code is working... anyway I found the problem
in AMFReader.cs you've set _groundZero to '2/2/1970' when it should be '1/1/1970' so it's was throwing all the dates off.

private DateTime _groundZero = DateTime.Parse("1/1/1970", null, System.Globalization.DateTimeStyles.AssumeUniversal & System.Globalization.DateTimeStyles.AdjustToUniversal);

thanks again for the great code :)

Josh

Read the full discussion online.

To add a post to this discussion, reply to this email (dotnetflex@discussions.codeplex.com)

To start a new discussion for this project, email dotnetflex@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com