[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-21 Thread valdhor
Looking at the ASP .NET Date Tutorial at http://www.easerve.com/developer/tutorials/asp-net-tutorials-dates.aspx you can figure out how the dates work. Using that I came up with the following which should help you out: ?xml version=1.0 encoding=utf-8? mx:Application pageTitle=World Time

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-17 Thread Mark
I agree with you 100% Josh but the better ones want the all might $$ and my company isn't willing to pay for it, it's just nice to have. So I need to find a free one or give it up. But I'm not willing to do that just yet... soon, but not yet. :-) They do have have some pseudocode on the

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-17 Thread Doug Lowder
Verify that you get midnight Jan 1, 1 AD from the following and you'll have the epoch adjustment value: new Date( -6213559680 ).toUTCString() Converting from timeticks returned by your webservice: var epochAdjustment: Number = -6213559680; var d: Date = new Date ( CurrentTimeTicks /

Re: [flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-17 Thread Josh McDonald
The .net Date stuff will work sensibly and probably just like Flash's, so I'd start with copying their code and work from there :) -Josh On Thu, Jul 17, 2008 at 10:37 PM, Mark [EMAIL PROTECTED] wrote: I agree with you 100% Josh but the better ones want the all might $$ and my company isn't

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-16 Thread Mark
I tried a few things along those lines and not even getting close... really: setDate = new Date(nanoSeconds/1000 - new Date().getTime()); RETURNS Tue Jun 20 09:55:17 GMT-0400 1933 setDate = new Date(nanoSeconds/(60*1000) - new Date().getTime ()); RETURNS Tue Jun 30 09:26:26 GMT-0400

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-16 Thread Doug Lowder
Sorry, I missed a parameter in there - that should have been new Date (0). new Date( CurrentTimeTicks / 1 - new Date(0).getTime() ) If you truly have a 100ns count since 1 AD as CurrentTimeTicks (the math works out, but you should still verify that with the webservice if possible), then

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-16 Thread Doug Lowder
Bah. Obviously I'm not testing any of this myself - I'm leaving that up to you! A call to new Date(0).getTime() will just return 0, so that won't work. What you need is the number of milliseconds *between* 1 AD 00:00:00 UTC and Jan 1, 1970 00:00:00 UTC. I don't think there's a way to use

Re: [flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-16 Thread Josh McDonald
Switch to a different web service, or call whoever provides it and get some documentation :) What the hell is 1AD? We haven't been keeping nice records since like 200AD or something. And do they count all the various leap seconds? What about that time when some pope rejigged the calendar and we

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-14 Thread Mark
I asked this question going into a weekend so I wanted to re-ask it today and see if anyone has any ideas on how to work this? Thank You, Mark --- In flexcoders@yahoogroups.com, Mark [EMAIL PROTECTED] wrote: The Web Service I found returns a few key pieces of data but I'm not sure how to

Re: [flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-14 Thread Josh McDonald
All typed off the top of my head in gmail and untested: //Get a date for the UTC time numbers will match, but will be in local time var foreignTime:Date = new Date(CurrentTimeTicks); //Strip our current (local) offset (check my -/+ math!) foreignTime.time -= foreignTime.getTimeZoneOffset() *

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-14 Thread Mark
Actually the problem is that the CurrentTimeTicks and UtcOffsetTicks is returned in nanoseconds or increment of 100 nanoseconds so I can't use, new Date(CurrentTimeTicks);. It returns as not a date Here's how the XML looks: TimeZoneInfo NameDateline Standard Time/Name

[flexcoders] Re: creating a World Clock and need a little help with the time and date

2008-07-14 Thread Doug Lowder
CurrentTimeTicks looks like a 100ns count from the year 1 AD. You could try: new Date( CurrentTimeTicks/1 - new Date().getTime() ) Then use the Date.toString() or Date.toUTCString() method to examine the result. You may need to adjust if CurrentTimeTicks isn't relative to UTC. Also,