That worked.  Thanks Doug.

                        // converts the Date to UTC by adding or 
subtracting the time zone offset
                        var PoffsetMilliseconds:Number = 
pTimeMS.getTimezoneOffset() * 60 * 1000;
                        pTimeMS.setTime(pTimeMS.getTime() + 
PoffsetMilliseconds);
                        
                        // converts the Date to UTC by adding or 
subtracting the time zone offset
                        var ToffsetMilliseconds:Number = 
tTimeMS.getTimezoneOffset() * 60 * 1000;
                        tTimeMS.setTime(tTimeMS.getTime() + 
ToffsetMilliseconds);

--- In flexcoders@yahoogroups.com, "Doug Lowder" <[EMAIL PROTECTED]> 
wrote:
>
> Hi Chris,
> 
> It seems like you are located in a GMT -0500 timezone, and what 
looks 
> like 19 hours being added to your time is actually 5 hours being 
> subtracted (24 - 5 = 19) so you end up seeing 19 hundred hours from 
> the previous day.  This is because the Date() constructor with a 
> single argument expects a value in GMT, but Flex does automatic 
> conversion to client local time.  Have a look at the 
> Date.getTimezoneOffset() method as a way to help convert to local 
> time.
> 
> HTH,
> Doug
> 
> --- In flexcoders@yahoogroups.com, "Chris" <chriskeeler0831@> 
> wrote:
> >
> > Bump...
> > 
> > --- In flexcoders@yahoogroups.com, "Chris" <chriskeeler0831@> 
> > wrote:
> > >
> > > So I have some code which formats milliseconds (for a video 
> player) 
> > > in 
> > > to NN:SS format.  When I try to add the hours (JJ:NN:SS), 
> > > DateFormatter adds 19 hours to the result.  WTF?  Code Below:
> > > 
> > >   private function formatTime(item:Date):String {
> > >             return dateFormatter.format(item);
> > >         }
> > >         private function videoDisplay_playheadUpdate():void {
> > >             /* If playhead time is 0, set to 100ms so the 
> > > DateFormatter doesnt return an empty string. */
> > >             var pT:Number = videoDisplay.playheadTime || 0.1;
> > >             var tT:Number = videoDisplay.totalTime;
> > > 
> > >             /* Convert playheadTime and totalTime from seconds 
to 
> > > milliseconds and create new Date objects. */
> > >             var pTimeMS:Date = new Date(pT * 1000);
> > >             var tTimeMS:Date = new Date(tT * 1000);
> > > 
> > >             vidCurrentTime.text = formatTime(pTimeMS);
> > >             vidTotalTime.text = formatTime(tTimeMS);
> > >             }
> > > 
> > >    <mx:DateFormatter id="dateFormatter" 
formatString="JJ:NN:SS" />
> > > 
> > > Any help is appreciated.
> > > Thanks.
> > > -Christopher Keeler
> > >
> >
>


Reply via email to