Re: How do I detect day lights savings?

2006-05-11 Thread Jim McAtee
This will tell you if a date/time is currently in DST, assuming it's in an 
area with the most common US DST rules.


//
// Determine if a date/time falls within Daylight Savings Time period
//   - 2AM on the first Sunday in April to 2AM on the last Sunday in 
October
//
function IsDST(dt) {
  var yr = Year(dt);
  var DSTBegin = CreateDateTime(yr, 4, 8 - DayOfWeek(CreateDate(yr, 4, 
7)), 2, 0, 0);
  var DSTEnd = CreateDateTime(yr, 10, 32 - DayOfWeek(CreateDate(yr, 10, 
31)), 2, 0, 0);
  return (dt gte DSTBegin) and (dt lt DSTEnd);
}



- Original Message - 
From: "Tony" <[EMAIL PROTECTED]>
To: "CF-Talk" 
Sent: Thursday, May 11, 2006 1:03 PM
Subject: Re: How do I detect day lights savings?


> :) never is so fun to say tho'
>
> tw
>
> On 5/11/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
>> Tony wrote:
>> > it works here in america, where the application i use it for will
>> > ALWAYS reside :)
>>
>> in the i18n world you just violated a big honking taboo, "never say
>> never". now you're screwed. probably have to make it i18n first thing
>> tomorrow ;-)
>>
>> > and yeah, congress... ill change it when it comes to that.
>>
>> you'll remember? lying on the fairway concussed by some errant golf 
>> ball?
>>
>> > so no, its not i18n friendly, but i bet you could help me get it 
>> > there!
>>
>> no need, the timezone CFC does most stuff folks need or have asked for.
>> though lately i've started to recommend using icu4j's timezone class as
>> the base for the CFC as it's olson data (and other tasty bits) get
>> updated way way more frequently than core java. and in any case 
>> updating
>> it is kind of difficult w/cf but you could get caught w/your pants 
>> down.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240290
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Tony
:) never is so fun to say tho'

tw

On 5/11/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
> Tony wrote:
> > it works here in america, where the application i use it for will
> > ALWAYS reside :)
>
> in the i18n world you just violated a big honking taboo, "never say
> never". now you're screwed. probably have to make it i18n first thing
> tomorrow ;-)
>
> > and yeah, congress... ill change it when it comes to that.
>
> you'll remember? lying on the fairway concussed by some errant golf ball?
>
> > so no, its not i18n friendly, but i bet you could help me get it there!
>
> no need, the timezone CFC does most stuff folks need or have asked for.
> though lately i've started to recommend using icu4j's timezone class as
> the base for the CFC as it's olson data (and other tasty bits) get
> updated way way more frequently than core java. and in any case updating
> it is kind of difficult w/cf but you could get caught w/your pants down.
>
> 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240257
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Paul Hastings
Tony wrote:
> it works here in america, where the application i use it for will
> ALWAYS reside :)

in the i18n world you just violated a big honking taboo, "never say 
never". now you're screwed. probably have to make it i18n first thing 
tomorrow ;-)

> and yeah, congress... ill change it when it comes to that.

you'll remember? lying on the fairway concussed by some errant golf ball?

> so no, its not i18n friendly, but i bet you could help me get it there!

no need, the timezone CFC does most stuff folks need or have asked for. 
though lately i've started to recommend using icu4j's timezone class as 
the base for the CFC as it's olson data (and other tasty bits) get 
updated way way more frequently than core java. and in any case updating 
it is kind of difficult w/cf but you could get caught w/your pants down.

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240251
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Tony
it works here in america, where the application i use it for will
ALWAYS reside :)
and yeah, congress... ill change it when it comes to that.

so no, its not i18n friendly, but i bet you could help me get it there!

tw

On 5/11/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
> Tony wrote:
>
> >> "04/01/#dateFormat(arguments.dateFeed,'')#">
> >> "11/01/#dateFormat(arguments.dateFeed,'')#">
>
>
> won't work in oz, etc. what happens when congress changes DST again?
>
> 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240250
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Paul Hastings
Tony wrote:

>"04/01/#dateFormat(arguments.dateFeed,'')#">
>"11/01/#dateFormat(arguments.dateFeed,'')#">


won't work in oz, etc. what happens when congress changes DST again?

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240245
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Tony
here is what i came up with.
may have been an adaption of someone elses
something, but its what i use










































  


On 5/11/06, Aaron Roberson <[EMAIL PROTECTED]> wrote:
> I just downloaded and am picking it apart - thanks!
>
> On 5/11/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
> > Aaron Roberson wrote:
> > > I have a banner that displays on the site every Wednesday at 2:00
> > > p.m.. However, I am afraid that when daylight savings time ends in
> > > October I am going to have to rewrite my code.
> > >
> > > It's a matter of chaning the value of a single variable, but what
> > > happens when I move on and another developer overseas the project?
> > > He/she won't know why that banner isn't displaying at the correct
> > > time.
> >
> > if all you need is to see is if a date is in DST in different timezones,
> > use the timezone CFC:
> >
> > http://www.sustainablegis.com/projects/tz/testTZCFC.cfm
> >
> >
>
> 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240243
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Aaron Roberson
I just downloaded and am picking it apart - thanks!

On 5/11/06, Paul Hastings <[EMAIL PROTECTED]> wrote:
> Aaron Roberson wrote:
> > I have a banner that displays on the site every Wednesday at 2:00
> > p.m.. However, I am afraid that when daylight savings time ends in
> > October I am going to have to rewrite my code.
> >
> > It's a matter of chaning the value of a single variable, but what
> > happens when I move on and another developer overseas the project?
> > He/she won't know why that banner isn't displaying at the correct
> > time.
>
> if all you need is to see is if a date is in DST in different timezones,
> use the timezone CFC:
>
> http://www.sustainablegis.com/projects/tz/testTZCFC.cfm
>
> 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240239
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How do I detect day lights savings?

2006-05-11 Thread Dawson, Michael
My first guess would be "no".  getTimeZoneInfo() will only pull the
"time zone" for the server on which it us called.  You would need to do
some date math and then you may be back to the original problem where
you began.

If I can think of anything, I'll post back.

M!ke 

-Original Message-
From: Aaron Roberson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 11, 2006 11:43 AM
To: CF-Talk
Subject: Re: How do I detect day lights savings?

If I set the locale to English (US) will that change the results
structure of the getTimeZoneInfo() to US time zone?

On 5/11/06, Aaron Roberson <[EMAIL PROTECTED]> wrote:
> > CF's getTimeZoneInfo() function.
>
> It looks like getTimeZoneInfo().isDSTOn is what I was looking for but 
> now another complexity arises.
>
> The getTimeZoneInfo function gets local time zone information for the 
> computer on which it is called, relative to Universal Time Coordinated

> (UTC). That means that it gets the time zone information of the remote

> server in Ireland, right? If Ireland has a different DST then 
> California, checking to see if the date on the remote server is DST 
> wouldn't really help.
>
> -Aaron

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240237
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Paul Hastings
Aaron Roberson wrote:
> I have a banner that displays on the site every Wednesday at 2:00
> p.m.. However, I am afraid that when daylight savings time ends in
> October I am going to have to rewrite my code.
> 
> It's a matter of chaning the value of a single variable, but what
> happens when I move on and another developer overseas the project?
> He/she won't know why that banner isn't displaying at the correct
> time.

if all you need is to see is if a date is in DST in different timezones, 
use the timezone CFC:

http://www.sustainablegis.com/projects/tz/testTZCFC.cfm

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240235
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Aaron Roberson
If I set the locale to English (US) will that change the results
structure of the getTimeZoneInfo() to US time zone?

On 5/11/06, Aaron Roberson <[EMAIL PROTECTED]> wrote:
> > CF's getTimeZoneInfo() function.
>
> It looks like getTimeZoneInfo().isDSTOn is what I was looking for but
> now another complexity arises.
>
> The getTimeZoneInfo function gets local time zone information for the
> computer on which it is called, relative to Universal Time Coordinated
> (UTC). That means that it gets the time zone information of the remote
> server in Ireland, right? If Ireland has a different DST then
> California, checking to see if the date on the remote server is DST
> wouldn't really help.
>
> -Aaron
>

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240234
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Aaron Roberson
> CF's getTimeZoneInfo() function.

It looks like getTimeZoneInfo().isDSTOn is what I was looking for but
now another complexity arises.

The getTimeZoneInfo function gets local time zone information for the
computer on which it is called, relative to Universal Time Coordinated
(UTC). That means that it gets the time zone information of the remote
server in Ireland, right? If Ireland has a different DST then
California, checking to see if the date on the remote server is DST
wouldn't really help.

-Aaron

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240232
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Aaron Roberson
I have a banner that displays on the site every Wednesday at 2:00
p.m.. However, I am afraid that when daylight savings time ends in
October I am going to have to rewrite my code.

It's a matter of chaning the value of a single variable, but what
happens when I move on and another developer overseas the project?
He/she won't know why that banner isn't displaying at the correct
time.

Thanks,
Aaron

P.S. Our remote server is in Ireland and the time the banner is
supposed to display is on Wednesday from 2:00 to 3:00 p.m. PT & PST.

Here is the current code:









On 5/11/06, Everett, Al (NIH/NIGMS) [C] <[EMAIL PROTECTED]> wrote:
> The calendar is universal. Daylight Savings Time isn't. In the U.S., DST
> begins the first Sunday in April and ends the last Sunday in October
> (and is changing in 2007 I believe). But not all areas of the U.S.
> participate in DST. The rules for DST in the UK are different. Then
> there's every other country, some of which have DST, many do not.
>
> What is it that you are trying to accomplish?

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240230
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How do I detect day lights savings?

2006-05-11 Thread Everett, Al \(NIH/NIGMS\) [C]
Well look at that: I actually learned something today.

Thanks all for the responses to this question that were much, much more
helpful than mine.

-Original Message-
The calendar is universal. Daylight Savings Time isn't. In the U.S., DST
begins the first Sunday in April and ends the last Sunday in October
(and is changing in 2007 I believe). But not all areas of the U.S.
participate in DST. The rules for DST in the UK are different. Then
there's every other country, some of which have DST, many do not.

What is it that you are trying to accomplish?

-Original Message-
From: Aaron Roberson [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 11, 2006 11:52 AM
To: CF-Talk
Subject: How do I detect day lights savings?

Okay, so there is a fucntion (isLeapYear) that checks if the current
year is a leap year, which makes me think that there should be some way
of detecting if the current time is daylights savings.

Any ideas on how to do this?

Thanks in advance,
Aaron

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240228
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How do I detect day lights savings?

2006-05-11 Thread Dawson, Michael
CF's getTimeZoneInfo() function.

M!ke 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240227
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How do I detect day lights savings?

2006-05-11 Thread Paul Hastings
Aaron Roberson wrote:
> Okay, so there is a fucntion (isLeapYear) that checks if the current
> year is a leap year, which makes me think that there should be some
> way of detecting if the current time is daylights savings.

isaac dealy & i were working on that functionality for the TimeZone CFC 
but it's kind of been collecting dust lately though. the icu4j folks 
have promised to build in a method for that which would probably work 
better (as we're parsing it out of the timezone ID string). the icu4j 
releases way way more frequently than core java (and less hassles as far 
as cf is concerned) so that looks to be a better approach. no more 
"oops, tomorrow's DST change has been changed to next month" like 
australia's recent issue.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240226
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How do I detect day lights savings?

2006-05-11 Thread Katz, Dov B \(IT\)
In java you do this:

TimeZone.getDefault().inDaylightTime(java.util.Date d)

(replace getDefault with something else if you want...)

Try something like this in cf-script perhaps?

Var tzClass = createObject("java","java.util.TimeZone");
Var dt= createObject("java","java.util.Date");
Dt.init();
Var indst=tz.inDaylightTime(dt);

This will ask the timezone if the given date is in Daylight savings
Dov


-Original Message-
From: Everett, Al (NIH/NIGMS) [C] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 11, 2006 11:58 AM
To: CF-Talk
Subject: RE: How do I detect day lights savings?

The calendar is universal. Daylight Savings Time isn't. In the U.S., DST
begins the first Sunday in April and ends the last Sunday in October
(and is changing in 2007 I believe). But not all areas of the U.S.
participate in DST. The rules for DST in the UK are different. Then
there's every other country, some of which have DST, many do not.

What is it that you are trying to accomplish?

-Original Message-
From: Aaron Roberson [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 11, 2006 11:52 AM
To: CF-Talk
Subject: How do I detect day lights savings?

Okay, so there is a fucntion (isLeapYear) that checks if the current
year is a leap year, which makes me think that there should be some way
of detecting if the current time is daylights savings.

Any ideas on how to do this?

Thanks in advance,
Aaron



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240224
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How do I detect day lights savings?

2006-05-11 Thread Everett, Al \(NIH/NIGMS\) [C]
The calendar is universal. Daylight Savings Time isn't. In the U.S., DST
begins the first Sunday in April and ends the last Sunday in October
(and is changing in 2007 I believe). But not all areas of the U.S.
participate in DST. The rules for DST in the UK are different. Then
there's every other country, some of which have DST, many do not.

What is it that you are trying to accomplish?

-Original Message-
From: Aaron Roberson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 11, 2006 11:52 AM
To: CF-Talk
Subject: How do I detect day lights savings?

Okay, so there is a fucntion (isLeapYear) that checks if the current
year is a leap year, which makes me think that there should be some way
of detecting if the current time is daylights savings.

Any ideas on how to do this?

Thanks in advance,
Aaron

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240221
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


How do I detect day lights savings?

2006-05-11 Thread Aaron Roberson
Okay, so there is a fucntion (isLeapYear) that checks if the current
year is a leap year, which makes me think that there should be some
way of detecting if the current time is daylights savings.

Any ideas on how to do this?

Thanks in advance,
Aaron

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240220
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54