[flexcoders] Re: timezone and dateformatter
That's correct though, isn't it? If I'm a user in CST and I access your app on 4/30 at 9PM, I'd probably be wondering How could my LAST billing date be 5/1, which isn't until tomorrow? But if that's what you want, you can add the timezone offset to the date being formatted. If item.lastBillingDate is Date object, return df.format( new Date( item.lastBillingDate.getTime() + item.lastBillingDate.getTimezoneOffset()*6 ) ); Your Java code should be returning a date in UTC. If it isn't, you'll have to adjust for that offset as well. --- In [EMAIL PROTECTED], Dimitrios Gianninas [EMAIL PROTECTED] wrote: Just wondering if anyone experienced this, but we have a VO coming from Java that contains a date field. Well I format the field using the coe below: mx:DateFormatter id=df formatString=-MM-DD / private function displayLastBillingDate( item:Object, column:DataGridColumn ):String { return df.format( item.lastBillingDate ); } And what happens is that this code works almost to well. It takes into account the end-users PC timezone! So the date coming back from the server is 2007-05-01 00:00:00, so for someone in EST it shows properly as 2007-05-01 (cause we are in EST) but for someone in CST is shows 2007-04-30... anything we can do about this? How do I get the end-user timezone setting ? Dimitrios Gianninas Developer Optimal Payments Inc. -- WARNING --- This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e- mail in error, please notify the sender. AVIS IMPORTANT -- Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur.
[flexcoders] Re: timezone and dateformatter
I thought the Player got the timezone from the underlying OS. --- In [EMAIL PROTECTED], Douglas Knudsen [EMAIL PROTECTED] wrote: yes, we had big issues with a app in Flex 1.5 and now 2.0 because of this. We coded around it by massaging the dates in AS with the clients timezone offset. Works well, except for those folks living in Arizona. For some reason the Flash Player does NOT pick up their offset correctly. Outside of the Navajo Nation, Arizona does not follow day light savings, yet the Flash player seems to think they do. DK On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas [EMAIL PROTECTED] wrote: Just wondering if anyone experienced this, but we have a VO coming from Java that contains a date field. Well I format the field using the coe below: mx:DateFormatter id=df formatString=-MM-DD / * private * *function* displayLastBillingDate( item:Object, column:DataGridColumn ):String { * return* df.format( item.lastBillingDate ); } And what happens is that this code works almost to well. It takes into account the end-users PC timezone! So the date coming back from the server is 2007-05-01 00:00:00, so for someone in EST it shows properly as 2007-05-01 (cause we are in EST) but for someone in CST is shows 2007-04-30... anything we can do about this? How do I get the end- user timezone setting ? *Dimitrios Gianninas* *Developer* *Optimal Payments Inc.* *AVIS IMPORTANT* *WARNING* Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur. This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e- mail in error, please notify the sender. -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Re: timezone and dateformatter
yes, but for some reason we see a difference for these AZ users. Their windows clock is correct, but the offset is off a hour in FP during DST. DK On 13 Apr 2007 11:42:41 -0700, Doug Lowder [EMAIL PROTECTED] wrote: I thought the Player got the timezone from the underlying OS. --- In [EMAIL PROTECTED] flexcoders%40yahoogroups.com, Douglas Knudsen [EMAIL PROTECTED] wrote: yes, we had big issues with a app in Flex 1.5 and now 2.0 because of this. We coded around it by massaging the dates in AS with the clients timezone offset. Works well, except for those folks living in Arizona. For some reason the Flash Player does NOT pick up their offset correctly. Outside of the Navajo Nation, Arizona does not follow day light savings, yet the Flash player seems to think they do. DK On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas [EMAIL PROTECTED] wrote: Just wondering if anyone experienced this, but we have a VO coming from Java that contains a date field. Well I format the field using the coe below: mx:DateFormatter id=df formatString=-MM-DD / * private * *function* displayLastBillingDate( item:Object, column:DataGridColumn ):String { * return* df.format( item.lastBillingDate ); } And what happens is that this code works almost to well. It takes into account the end-users PC timezone! So the date coming back from the server is 2007-05-01 00:00:00, so for someone in EST it shows properly as 2007-05-01 (cause we are in EST) but for someone in CST is shows 2007-04-30... anything we can do about this? How do I get the end- user timezone setting ? *Dimitrios Gianninas* *Developer* *Optimal Payments Inc.* *AVIS IMPORTANT* *WARNING* Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur. This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e- mail in error, please notify the sender. -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Re: timezone and dateformatter
Weird. Do you have any confirmation this is a bug in the Player? --- In [EMAIL PROTECTED], Douglas Knudsen [EMAIL PROTECTED] wrote: yes, but for some reason we see a difference for these AZ users. Their windows clock is correct, but the offset is off a hour in FP during DST. DK On 13 Apr 2007 11:42:41 -0700, Doug Lowder [EMAIL PROTECTED] wrote: I thought the Player got the timezone from the underlying OS. --- In [EMAIL PROTECTED] flexcoders% 40yahoogroups.com, Douglas Knudsen douglasknudsen@ wrote: yes, we had big issues with a app in Flex 1.5 and now 2.0 because of this. We coded around it by massaging the dates in AS with the clients timezone offset. Works well, except for those folks living in Arizona. For some reason the Flash Player does NOT pick up their offset correctly. Outside of the Navajo Nation, Arizona does not follow day light savings, yet the Flash player seems to think they do. DK On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas dimitrios.gianninas@ wrote: Just wondering if anyone experienced this, but we have a VO coming from Java that contains a date field. Well I format the field using the coe below: mx:DateFormatter id=df formatString=-MM-DD / * private * *function* displayLastBillingDate( item:Object, column:DataGridColumn ):String { * return* df.format( item.lastBillingDate ); } And what happens is that this code works almost to well. It takes into account the end-users PC timezone! So the date coming back from the server is 2007-05-01 00:00:00, so for someone in EST it shows properly as 2007-05-01 (cause we are in EST) but for someone in CST is shows 2007-04-30... anything we can do about this? How do I get the end- user timezone setting ? *Dimitrios Gianninas* *Developer* *Optimal Payments Inc.* *AVIS IMPORTANT* *WARNING* Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur. This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e- mail in error, please notify the sender. -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Re: timezone and dateformatter
nope. I can't find any mention of this anywhere. Might be known to some flash pros, but a flash pro I am not. I suppose this is only a issue if you want times always displayed based on a fixed timezone regardless of where the user is. I have not confirmed this behavior using coldfusion on the back end, just Java. In our case, we are able to code around this by using rationals instead of date fields, a soon to be used fix. We just need a start time and end time between 6am to 10pm and have a separate field with only the date. so we can refactor to use some rational between 6 and 22. DK On 13 Apr 2007 12:05:00 -0700, Doug Lowder [EMAIL PROTECTED] wrote: Weird. Do you have any confirmation this is a bug in the Player? --- In [EMAIL PROTECTED] flexcoders%40yahoogroups.com, Douglas Knudsen [EMAIL PROTECTED] wrote: yes, but for some reason we see a difference for these AZ users. Their windows clock is correct, but the offset is off a hour in FP during DST. DK On 13 Apr 2007 11:42:41 -0700, Doug Lowder [EMAIL PROTECTED] wrote: I thought the Player got the timezone from the underlying OS. --- In [EMAIL PROTECTED] flexcoders%40yahoogroups.comflexcoders% 40yahoogroups.com, Douglas Knudsen douglasknudsen@ wrote: yes, we had big issues with a app in Flex 1.5 and now 2.0 because of this. We coded around it by massaging the dates in AS with the clients timezone offset. Works well, except for those folks living in Arizona. For some reason the Flash Player does NOT pick up their offset correctly. Outside of the Navajo Nation, Arizona does not follow day light savings, yet the Flash player seems to think they do. DK On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas dimitrios.gianninas@ wrote: Just wondering if anyone experienced this, but we have a VO coming from Java that contains a date field. Well I format the field using the coe below: mx:DateFormatter id=df formatString=-MM-DD / * private * *function* displayLastBillingDate( item:Object, column:DataGridColumn ):String { * return* df.format( item.lastBillingDate ); } And what happens is that this code works almost to well. It takes into account the end-users PC timezone! So the date coming back from the server is 2007-05-01 00:00:00, so for someone in EST it shows properly as 2007-05-01 (cause we are in EST) but for someone in CST is shows 2007-04-30... anything we can do about this? How do I get the end- user timezone setting ? *Dimitrios Gianninas* *Developer* *Optimal Payments Inc.* *AVIS IMPORTANT* *WARNING* Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur. This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e- mail in error, please notify the sender. -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Re: timezone and dateformatter
I've also ran accross this, not so much a bug though. It works properly in its use case. The problem is, there are other use cases with timezones. Here is my scenario: I work with a legacy database. Unfortunately, all datetimes are saved into the database as UTC, but as the clients time zone. So say someone in the EST -5 UTC and someone at PST -8 UTC both saved at the same moment in time (5am EST). The database would have saved the dates as following: EST - 05:00 PST - 02:00 I can't change the behavior due to only being one piece in the grand scheme of the application. The problem is, the databse doesnt' know what timezone these are. The system was designed to just show that datetime to the user if they ask for it. Flash/Flex always converts AMF Dates to the local timezone. I've asked for a way to hook into that deserialization, but I haven't gotten a response. Therefore, I massage every date I receive and every date I send using the following... * public* *static* *function* getUTCDate(myDate:Date):Date { *if* (myDate == *null*) *return* *null*; *else * *return* *new* Date(myDate.fullYearUTC, myDate.monthUTC, myDate.dateUTC, myDate.hoursUTC, myDate.minutesUTC, myDate.secondsUTC, myDate.millisecondsUTC); } *public* *static* *function* sendUTCDate(myDate:Date):Date { *if* (myDate == *null*) *return* *null*; *else * { *var* sDate:Date = *new* Date(Date.UTC(myDate.fullYear, myDate.month, myDate.date, myDate.hours, myDate.minutes, myDate.seconds, myDate.milliseconds)); *return* sDate; } } Hope this helps, but I hope even more there is a better solution out there Sam On 13 Apr 2007 12:23:01 -0700, Douglas Knudsen [EMAIL PROTECTED] wrote: nope. I can't find any mention of this anywhere. Might be known to some flash pros, but a flash pro I am not. I suppose this is only a issue if you want times always displayed based on a fixed timezone regardless of where the user is. I have not confirmed this behavior using coldfusion on the back end, just Java. In our case, we are able to code around this by using rationals instead of date fields, a soon to be used fix. We just need a start time and end time between 6am to 10pm and have a separate field with only the date. so we can refactor to use some rational between 6 and 22. DK On 13 Apr 2007 12:05:00 -0700, Doug Lowder [EMAIL PROTECTED] wrote: Weird. Do you have any confirmation this is a bug in the Player? --- In [EMAIL PROTECTED] flexcoders%40yahoogroups.com, Douglas Knudsen [EMAIL PROTECTED] wrote: yes, but for some reason we see a difference for these AZ users. Their windows clock is correct, but the offset is off a hour in FP during DST. DK On 13 Apr 2007 11:42:41 -0700, Doug Lowder [EMAIL PROTECTED] wrote: I thought the Player got the timezone from the underlying OS. --- In [EMAIL PROTECTED] flexcoders%40yahoogroups.comflexcoders% 40yahoogroups.com, Douglas Knudsen douglasknudsen@ wrote: yes, we had big issues with a app in Flex 1.5 and now 2.0 because of this. We coded around it by massaging the dates in AS with the clients timezone offset. Works well, except for those folks living in Arizona. For some reason the Flash Player does NOT pick up their offset correctly. Outside of the Navajo Nation, Arizona does not follow day light savings, yet the Flash player seems to think they do. DK On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas dimitrios.gianninas@ wrote: Just wondering if anyone experienced this, but we have a VO coming from Java that contains a date field. Well I format the field using the coe below: mx:DateFormatter id=df formatString=-MM-DD / * private * *function* displayLastBillingDate( item:Object, column:DataGridColumn ):String { * return* df.format( item.lastBillingDate ); } And what happens is that this code works almost to well. It takes into account the end-users PC timezone! So the date coming back from the server is 2007-05-01 00:00:00, so for someone in EST it shows properly as 2007-05-01 (cause we are in EST) but for someone in CST is shows 2007-04-30... anything we can do about this? How do I get the end- user timezone setting ? *Dimitrios Gianninas* *Developer* *Optimal Payments Inc.* *AVIS IMPORTANT* *WARNING* Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu
[flexcoders] Re: timezone and dateformatter
Sounds like some of our legacy tables, where someone decided to store dates as formatted varchar strings instead of something more appropriate like Date or Timestamp. What a pain. If you're forced to use the existing datetime column, I guess there isn't much you can do. If not, maybe you could add a numeric column and store the dates as milliseconds since epoch. That would make retrieving ( new Date(valFromDb) ) and sending ( myDate.getTime() ) pseudo-date values easier. --- In [EMAIL PROTECTED], Sam Shrefler [EMAIL PROTECTED] wrote: I've also ran accross this, not so much a bug though. It works properly in its use case. The problem is, there are other use cases with timezones. Here is my scenario: I work with a legacy database. Unfortunately, all datetimes are saved into the database as UTC, but as the clients time zone. So say someone in the EST -5 UTC and someone at PST -8 UTC both saved at the same moment in time (5am EST). The database would have saved the dates as following: EST - 05:00 PST - 02:00 I can't change the behavior due to only being one piece in the grand scheme of the application. The problem is, the databse doesnt' know what timezone these are. The system was designed to just show that datetime to the user if they ask for it. Flash/Flex always converts AMF Dates to the local timezone. I've asked for a way to hook into that deserialization, but I haven't gotten a response. Therefore, I massage every date I receive and every date I send using the following... * public* *static* *function* getUTCDate(myDate:Date):Date { *if* (myDate == *null*) *return* *null*; *else * *return* *new* Date(myDate.fullYearUTC, myDate.monthUTC, myDate.dateUTC, myDate.hoursUTC, myDate.minutesUTC, myDate.secondsUTC, myDate.millisecondsUTC); } *public* *static* *function* sendUTCDate(myDate:Date):Date { *if* (myDate == *null*) *return* *null*; *else * { *var* sDate:Date = *new* Date(Date.UTC(myDate.fullYear, myDate.month, myDate.date, myDate.hours, myDate.minutes, myDate.seconds, myDate.milliseconds)); *return* sDate; } } Hope this helps, but I hope even more there is a better solution out there Sam On 13 Apr 2007 12:23:01 -0700, Douglas Knudsen [EMAIL PROTECTED] wrote: nope. I can't find any mention of this anywhere. Might be known to some flash pros, but a flash pro I am not. I suppose this is only a issue if you want times always displayed based on a fixed timezone regardless of where the user is. I have not confirmed this behavior using coldfusion on the back end, just Java. In our case, we are able to code around this by using rationals instead of date fields, a soon to be used fix. We just need a start time and end time between 6am to 10pm and have a separate field with only the date. so we can refactor to use some rational between 6 and 22. DK On 13 Apr 2007 12:05:00 -0700, Doug Lowder [EMAIL PROTECTED] wrote: Weird. Do you have any confirmation this is a bug in the Player? --- In [EMAIL PROTECTED] flexcoders% 40yahoogroups.com, Douglas Knudsen douglasknudsen@ wrote: yes, but for some reason we see a difference for these AZ users. Their windows clock is correct, but the offset is off a hour in FP during DST. DK On 13 Apr 2007 11:42:41 -0700, Doug Lowder douglowder@ wrote: I thought the Player got the timezone from the underlying OS. --- In [EMAIL PROTECTED] flexcoders% 40yahoogroups.comflexcoders% 40yahoogroups.com, Douglas Knudsen douglasknudsen@ wrote: yes, we had big issues with a app in Flex 1.5 and now 2.0 because of this. We coded around it by massaging the dates in AS with the clients timezone offset. Works well, except for those folks living in Arizona. For some reason the Flash Player does NOT pick up their offset correctly. Outside of the Navajo Nation, Arizona does not follow day light savings, yet the Flash player seems to think they do. DK On 13 Apr 2007 10:52:07 -0700, Dimitrios Gianninas dimitrios.gianninas@ wrote: Just wondering if anyone experienced this, but we have a VO coming from Java that contains a date field. Well I format the field using the coe below: mx:DateFormatter id=df formatString=-MM-DD / * private * *function* displayLastBillingDate( item:Object, column:DataGridColumn ):String { * return* df.format( item.lastBillingDate ); } And what happens is that this code works almost to well. It takes into account the end-users PC timezone! So the date coming back from the server is 2007-05-01 00:00:00, so for someone in