Hi,
I have a cfquery that is hosted in Delaware, but I live in Hawaii(Hawaii is 5
hours behind of Delaware).
When I use
<cfset tipdate = #CreateODBCDate(now())#>
<cfset time = dateadd("h",+5,tipdate) /><br>
<cfoutput>#tipdate#</cfoutput><br>
<cfoutput>#TimeFormat(tipdate,'hh:mm tt')#</cfoutput><br />
I get:
{d '2011-01-08'}
10:24 PM
what I am trying to do is to convert the time to Hawaii. As I believe that
#CreateODBCDate(now())# starts at 12:00 AM on today, that is for 1/8/11 at
12:00 pm it starts.
So when this changes day by day at 12:00 Am in Delaware, if I add 5 hours to
this it will update at 12:00 AM here in Hawaii? Also in this code is this the
best way to do this?
thanks so much,
Johnny
<!--- complete code--->
<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,and display it or display error
message--->
<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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:5183
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm