Welcome Guest Search | Active Topics | Members | Log In | Register

Flex datetime Options · View
markzolotoy
Posted: Friday, July 27, 2012 8:52:59 AM
Rank: Apprentice Coder
Groups: Member

Joined: 4/29/2011
Posts: 68
Points: 192
Looks like when I get a date from the server it gets converted by the middle tier into a local date. Is it possible to prevent dates serialization?

Thanks
Mark Piller
Posted: Friday, July 27, 2012 8:36:02 PM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
This is done per the AMF specification. WebORB serializes dates in the UTF0 timezone.

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
markzolotoy
Posted: Saturday, July 28, 2012 5:20:26 AM
Rank: Apprentice Coder
Groups: Member

Joined: 4/29/2011
Posts: 68
Points: 192
Ok, but it is possible to get a date value without serialization? I tried to remove date type in config file but the results are still the same.
Mark Piller
Posted: Saturday, July 28, 2012 4:52:16 PM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
No, it is not possible.

Serialization is what transfers the value from the server to the client. Without the serialization, how would the client get the value?

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
markzolotoy
Posted: Sunday, July 29, 2012 7:46:29 AM
Rank: Apprentice Coder
Groups: Member

Joined: 4/29/2011
Posts: 68
Points: 192
I understand that but I need to have a date value with no time zone being applied.
Is that possible?

Thanks
Mark Piller
Posted: Monday, July 30, 2012 9:35:48 PM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
It is not possible if your server side code returns dates as .NET date objects. To preserve the server-side timezone, you need to return dates as Strings.

Alternatively, if the client app knows the timezone of the server, it can recalculate the date accordingly.

Mark

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
markzolotoy
Posted: Tuesday, July 31, 2012 1:36:27 AM
Rank: Apprentice Coder
Groups: Member

Joined: 4/29/2011
Posts: 68
Points: 192
Yes, strings are a way to go. But what I am trying to preserve is not a server time but rather the original time value that was entered by a user. Let's say this is a time of an appointment.
It has to be 2 pm everywhere. Time zone in this case is irrelevant, so the server time.
markzolotoy
Posted: Tuesday, July 31, 2012 1:41:12 PM
Rank: Apprentice Coder
Groups: Member

Joined: 4/29/2011
Posts: 68
Points: 192
Sorry to be such an idiot, but while I was playing with server serialization configuration I removed Date type. Now, brought it back but I am still having an error that a date that hits the server is null. What exactly do I do make sure Date is getting serialized?

Thank you.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.148 seconds.