Preserve the date sending from/to between client UI and server back end regardless timezone
Use an intermediate variable with additional computation to do the transfer
In this blog entry http://flexblog.faratasystems.com/?p=289, Anatole described the underneath how BlazeDS does the data/time transfer and gave a solution to date/time transfer in Flex Application when client and server are in different timezone. But the solution is limitted to the point that, you have to set your server in GMT timezone which might affect other applications if they're running in the same VM.




package{ [Bindable] [RemoteClass(alias="mypackage.Booking")] public class Booking { [Transient] public var startDate:Date; [Transient] public var endDate:Date; public function set adjustedStartDate(value:Date):void { var newDate:Date = new Date(value.valueOf() - value.timezoneOffset); this.startDate = newDate; } [Bindable(event="justIgnored")] public function get adjustedStartDate():Date { var newDate:Date = new Date(startDate.valueOf() + startDate.timezoneOffset); return newDate; } public function set adjustedEndDate(value:Date):void { var newDate:Date = new Date(value.valueOf() - value.timezoneOffset); this.endDate = newDate; } [Bindable(event="justIgnored")] public function get adjustedEndDate():Date { var newDate:Date = new Date(endDate.valueOf() + endDate.timezoneOffset); return newDate; } }}package mypackage; import java.io.Serializable;import java.util.Date;import java.util.TimeZone; /** * @author trung * */public class Booking implements Serializable { /** * */ private static final long serialVersionUID = -4227973768782813114L; transient private Date startDate; transient private Date endDate; public Date getAjustedStartDate() { Date newDate = new Date(startDate.getTime() - TimeZone.getDefault().getOffset(startDate.getTime())); return newDate; } public void setAjustedStartDate(Date value) { Date newDate = new Date(value.getTime() + TimeZone.getDefault().getOffset(value.getTime())); this.startDate = newDate; } public Date getAjustedEndDate() { Date newDate = new Date(endDate.getTime() - TimeZone.getDefault().getOffset(endDate.getTime())); return newDate; } public void setAjustedEndDate(Date value) { Date newDate = new Date(value.getTime() + TimeZone.getDefault().getOffset(value.getTime())); this.endDate = newDate; } public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public Date getEndDate() { return endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; }}