You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by jfb <j....@verizon.net> on 2016/06/17 10:30:49 UTC

Time zone issue

Hi All,
I am having this issue
http://www.axelscript.com/2008/02/20/timezone-issues-with-remote-datetime-data-and-flash/
This post is old, we are using SDK 4.12. I have this issue in all my forms
(they are many) that I use datechooser.
My web and database servers are adjusted to US Easter datetime zone, the
issue is for my users in hawaii time zone.
Is there a better way to handle this issue? 
Thanks !



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Time zone issue

Posted by Paul Hastings <pa...@gmail.com>.
On 6/17/2016 8:47 PM, jfb wrote:
> Thanks for your help and reply Alex,
> Yes, using the string fix the issue but i have many of my components/modules
> using dateChooser, it is a huge time consuming in my app. My friends in the

i'm not sure you're going to get away not doing anything. i assume that you want 
the EST timezone (tz) datetimes displayed in the HAST tz?

if so maybe this:
our cf apps turn the datetimes from the db (sql server in most cases) into java 
epoch (ms since 1-1-1970) & passes that back to the flex client. on the flex 
side, the flex app does a new date w/the java epoch data which should cast to 
the client tz automagically. sending datetimes back to the server you reverse 
the process.

the cf code is pretty simple just dateTimeObject.getTime() & 
dateTimeObject.setTime(). i have cf code for this i can send along if you want 
(have to be tomorrow just shutdown my dev server) but its really just a line or 
two code.

> other project using extJS are booooing flex :)

this is a design issue, but tz are a big PITA & require some thought. if extJS 
fronted a cf app (as its datetimes are sans tz), they would be in the same boat.

> class="org.myapp.flex.proxy.MyProxyBootstrapService"/>
> I am using coldFusion 9. I am not sure where to store the java files and how
> to defined the class call, anyone knows this?

going by bad memory (i haven't seen cf9 in years), you can place the compiled 
java classes anywhere on cf's classpath, though normally "WEB-INF/lib". it will 
require a cf server service restart to pick up the new classes.


Re: Time zone issue

Posted by jfb <j....@verizon.net>.
This is crazy,
If I use the DateField in the same time zone as EST, when I pass the date to
the database as myDF.selectedDate it only pass "MM/DD/YYYY" but if I use in
different time zone it includes the time.
How can I also include the time when i am using the dateField in EST?
The issue is when the dateField reads the date data from the database. The
data save is fine if i included the time.
Thanks !



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851p12882.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Time zone issue

Posted by jfb <j....@verizon.net>.
The fixed works in my laptop using window 7.
When I move the solution to my windows 2003 server with CF9 it doesn't work.
I try copying the .jar file into the C:\ColdFusion9\wwwroot\WEB-INF\LIB but
it doesn't work either.
I also copied the new compiled file of mainApp.swc into my server but it
doesn't work.
Any ideas in how to debug ? 
Thanks!



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851p12912.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Time zone issue

Posted by Alex Harui <ah...@adobe.com>.
Excellent, thanks for sharing.

-Alex

On 6/20/16, 9:17 AM, "jfb" <j....@verizon.net> wrote:

>This is the solution to my issue
>http://flexblog.faratasystems.com/index.php/flex-local-datestime-transfer-
>issue/
>
>I copied the LineItemDTO.java file into
>C:\ColdFusion9\wwwroot\WEB-INF\classes
>as package com;
>import java.io.Serializable; ...bla...
>
>In My app i have the folder src\com, I add the file to this folder as:
>package com
>{
>	import flash.events.EventDispatcher;
>	[RemoteClass(alias="com.LineItemDTO")] ... bla...
>Restart CF and start working. Now the client and server are using the same
>time zone.
>I hope this help to someone later :)
>Best,
>
>
>
>
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851p128
>86.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Time zone issue

Posted by jfb <j....@verizon.net>.
This is the solution to my issue
http://flexblog.faratasystems.com/index.php/flex-local-datestime-transfer-issue/

I copied the LineItemDTO.java file into
C:\ColdFusion9\wwwroot\WEB-INF\classes
as package com;
import java.io.Serializable; ...bla...

In My app i have the folder src\com, I add the file to this folder as:
package com
{
	import flash.events.EventDispatcher;
	[RemoteClass(alias="com.LineItemDTO")] ... bla...
Restart CF and start working. Now the client and server are using the same
time zone.
I hope this help to someone later :)
Best,







--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851p12886.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Time zone issue

Posted by jfb <j....@verizon.net>.
Found another link
http://flexblog.faratasystems.com/index.php/flex-local-datestime-transfer-issue/

where do I add the as file package com.farata.datasource.dto ?

do i need to convert the java file to jar?
Thanks 




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851p12883.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Time zone issue

Posted by Alex Harui <ah...@adobe.com>.

On 6/18/16, 12:42 PM, "jfb" <j....@verizon.net> wrote:

>The issue is in all my app with datechooser component.
>Can I extend this component and fix the date issue for any time zone?
>is there a global variable that I can adjust at the time my app load,
>check
>the time zone and adjust?
>I'm trying to do a temp fix, until I figure the suggestion on from my
>previous link.
>Thanks!

It might be possible to wrap the DateChooser and adjust the time as the
Date is passed in (and maybe reverse the adjustment if it comes back out).

-Alex


Re: Time zone issue

Posted by jfb <j....@verizon.net>.
The issue is in all my app with datechooser component.
Can I extend this component and fix the date issue for any time zone?
is there a global variable that I can adjust at the time my app load, check
the time zone and adjust?
I'm trying to do a temp fix, until I figure the suggestion on from my
previous link.
Thanks!




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851p12870.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Time zone issue

Posted by Alex Harui <ah...@adobe.com>.

On 6/17/16, 6:47 AM, "jfb" <j....@verizon.net> wrote:

>Thanks for your help and reply Alex,
>Yes, using the string fix the issue but i have many of my
>components/modules
>using dateChooser, it is a huge time consuming in my app. My friends in
>the
>other project using extJS are booooing flex :)

How would extJS handle this any better?

IMO, it isn't about DateChooser it is about what you send/receive from the
backend.  One way to think about is that you effectively want someone to
see a printed version of data printed in a different timezone, essentially
like sending them a PDF, and thus String may be the right data type to
use, instead of Date which is intended to be converted to local time.

>
>I found this:
>http://stackoverflow.com/questions/6503924/flex-handling-timezone-offset
>I have this folder C:\ColdFusion9\wwwroot\WEB-INF\flex where is the
>services-config.xml file.
>Inside the file i see this line:
><service id="myProxyBootstrapService"
>class="org.myapp.flex.proxy.MyProxyBootstrapService"/>
>I am using coldFusion 9. I am not sure where to store the java files and
>how
>to defined the class call, anyone knows this?

I think there may be ColdFusion forums that can help you.  I haven't done
much CF work.

-Alex


Re: Time zone issue

Posted by jfb <j....@verizon.net>.
Thanks for your help and reply Alex,
Yes, using the string fix the issue but i have many of my components/modules
using dateChooser, it is a huge time consuming in my app. My friends in the
other project using extJS are booooing flex :)

I found this:
http://stackoverflow.com/questions/6503924/flex-handling-timezone-offset
I have this folder C:\ColdFusion9\wwwroot\WEB-INF\flex where is the
services-config.xml file.
Inside the file i see this line:
<service id="myProxyBootstrapService"
class="org.myapp.flex.proxy.MyProxyBootstrapService"/>
I am using coldFusion 9. I am not sure where to store the java files and how
to defined the class call, anyone knows this?
Thanks,




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851p12856.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Time zone issue

Posted by Alex Harui <ah...@adobe.com>.
I think there are other posts on the internet about using a String instead
of Date/DateTime.

IMO, a Date is a point in time in UTC that you "want" to have converted to
local time for the viewer.  But if you want someone in another timezone to
see what you are seeing in some reference timezone, then you don't want
the the Date to be converted.  I think even the default Java libraries
have this same behavior, but the Java ecosystem has a richer Date library
that controls conversion for these kinds of scenarios.  I think a similar
library needs to be written for Flex.  Not sure if someone has already
done it.  But short of that, using a String should work in many cases.

-Alex

On 6/17/16, 3:30 AM, "jfb" <j....@verizon.net> wrote:

>Hi All,
>I am having this issue
>http://www.axelscript.com/2008/02/20/timezone-issues-with-remote-datetime-
>data-and-flash/
>This post is old, we are using SDK 4.12. I have this issue in all my forms
>(they are many) that I use datechooser.
>My web and database servers are adjusted to US Easter datetime zone, the
>issue is for my users in hawaii time zone.
>Is there a better way to handle this issue?
>Thanks !
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Time-zone-issue-tp12851.htm
>l
>Sent from the Apache Flex Users mailing list archive at Nabble.com.