Here's a tag I did for myself that doesn't take into account the time of
day.  It takes as an argument a date and returns TRUE or FALSE.  Taking into
accont the time of day would be simple, just by adding to the begin
date/time a time offset of 2:00am and then doing the same with the end
date/time (on the last Sunday, rather than the last Saturday of October,
i.e. remove the "- 1").

Jim


<cfsetting enablecfoutputonly="yes">
<!---
      cf_IsDST

      Determine if a date is within the daylight savings time period.

      Return TRUE or FALSE in the caller variable specified.
--->

<cfparam name="attributes.date" type="date">
<cfparam name="attributes.variable">

<!--- Extract year from the given date --->
<cfset y = Year(attributes.date)>

<!--- First Sunday in April --->
<cfset beginday = "4/#Val(8 - DayOfWeek("4/7/#y#"))#/#y#">

<!--- Last Saturday in October --->
<cfset endday = "10/#Val(32 - DayOfWeek("10/31/#y#"))#/#y#" - 1>

<!--- Set caller variable --->
<cfset SetVariable("caller.#attributes.variable#",
       (attributes.date gte beginday) and (attributes.date lt endday))>

<cfsetting enablecfoutputonly="no">



----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, October 29, 2001 9:28 AM
Subject: Determining Daylight Savings


> Hello,
>
> I have an issue that others may be running into or have solved. I am
> posting a series of events with their date, time, and time zone, i.e.
> EST. Is there a custom tag or UDF that will return whether a
> date/time is in Daylight Savings or not? It would need to work like
> the parameter isDSTon from GetTimeZoneInfo() but allow a date to be
> passed in. Any advice?
>
> Thank you,
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to