Wrap it up in a CFIF or CFCASE statement.
<cfset currentHour = timeformat(now(),'hh')>
<cfif currentHour gte '08' and currentHour lt '12'>
<cfset imagetoDisplay = 'morning.png'>
<cfelseif currentHour gte 12 and currentHour lt 5>
<cfset imagetoDisplay = 'afternoon.png'>
<cfelse>
<cfset imagetoDisplay = 'restoftheday.png'>
</cfif>
<img src='images/#imagetoDisplay#' border=0>
That should do it.
HTH
Rob
On Tue, Jun 16, 2009 at 9:10 AM, Ian Vaughan <
[email protected]> wrote:
>
> Hi
>
> In Coldfusion can you restrict the display of a certain image for only
> certain times of the day?
>
> For example only display the image before 8pm 12pm-2pm and after 5pm on
> the site homepage
>
> If so any ideas on the best way to achieve this?
>
> TIA
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323527
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4