John, Can't you do this: <cfset tipdate = #CreateODBCDate(now(-5))#> ??
Do you have exclusive use of the server? (Not a shared server enviroment) If so, just change the server system time to Hawaii time! On Sun, Jan 9, 2011 at 12:04 AM, John Barrett <[email protected]> wrote: > > Hi Greg, thank so much! > I updated the page to show the time difference between the see and Hawaii: > http://www.gotnutrients.net/cf_newbie.cfm > > When I try to use <cfset tipdate = #Now()#> instead or <cfset tipdate = > #CreateODBCDate(now())#> I get an error, not sure why. > Also there is one error in the code, as I use the variable time to set the > offset, but that variable is never used, but when I change the time var to > tipdate no tip is displayed. > > The tip gets updated here in Hawaii at 7:00 pm instead of 12:00 pm(5 > hours), yep you were right subtracting 5 hours shows the same time as the > server, but I am still having issues displaying the tip, thanks so much > > <cfset tipdate = #CreateODBCDate(now())#> > <cfset time = dateadd("h",-5,tipdate) /> > > <!--- Get tips from the tips table---> > <cfquery name="rs_dailytip" datasource="#REQUEST.dataSource#"> > SELECT record_id, tipdate, dailytip, consumer_link,consumer_text, > research_link, research_text > FROM dailytips > WHERE tipdate = #tipdate# > </cfquery> > > <!--- check if there is a tip for today, sidplay, or display error > message---> > <title>get tips example</title> > > <cfif rs_dailytip.recordcount> > Today's Daily Tip:<p> > <cfoutput><em>#DateFormat(tipdate,'mmmm d, yyyy')#</cfoutput><br /> > <cfoutput>#rs_dailytip.dailytip#</cfoutput><p> > > Consumer Related Article:<br /> > <cfoutput><a href="#rs_dailytip.consumer_link#"> > #rs_dailytip.consumer_text#</a></cfoutput><br /> > > Research Related Article:<br /> > <cfoutput><a href="#rs_dailytip.research_link#"> > #rs_dailytip.research_text#</a></cfoutput> > <cfelse> > No Daily Tip Today! > </cfif> > <p> > > <b> Server Information</b><br /> > <cfoutput>#DateFormat(Now(),'mmmm d, yyyy')#</cfoutput >Delware Date<br /> > <cfoutput>#TimeFormat(Now(),'hh:mm tt')#</cfoutput> Delware Time<br /> > <p> > > <b>Hawaii Information to show like Ser Time</b><br /> > <cfoutput>#DateFormat(time,'mmmm d, yyyy')#</cfoutput> Hawaii Date<br> > <cfoutput>#TimeFormat(time,'hh:mm tt')#</cfoutput> Hawaii Time<br /> > <p> > > <b>Hawaii Information to reflect Server in Delware</b><br /> > <cfoutput>#DateFormat(tipdate,'mmmm d, yyyy')#</cfoutput> Hawaii Date<br> > <cfoutput>#TimeFormat(tipdate,'hh:mm tt')#</cfoutput> Hawaii Time<br />here > is the new code: > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5187 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm
