I have been trying to get this to just subtract 7 hours from the timestamp that is returned from the query. I can get it to subtract 7 days from the date but I cant figure out what I need to make it subtract 7 hours from the time. <cfset localdate = #date_time#> <cfset localtime = (#date_time# - 7)> #LSDateFormat("#localdate#", "mmm-dd-yyyy")# #LSTimeFormat("#localtime#", "hh:mm:sstt")# Code (markup): Thanks,
I bumped into the same problems a few months ago but I fixed it somehow else, please review www.php.net for date() function, you will find other ways
Thanks for the encouragement. I'm not familiar with php. I do all my server side script with cold fusion. It seems like such a simple thing to do but I swear i have been searching and searching all night and I cant find a single Coldfusion forum that has addressed this simple little math problem. Thanks Again,
<?php $lastWeek = time() - (7 * 24 * 60 * 60); // 7 days; 24 hours; 60 mins; 60secs echo 'Now: '. date('Y-m-d') ."\n"; echo 'Last Week: '. date('Y-m-d', $lastWeek) ."\n"; // or using strtotime(): echo 'Last Week: '. date('Y-m-d', strtotime('-1 week')) ."\n"; ?> math sucks, i know, but this has nothing 2 do with math.you owe me a bear
What is your brand and where would you like it sent? I'll buy you as many beers as you can drink if you can write that in coldfusion. Reason being my server only supports coldfusion.
i would look through the coldfusion documentation at all the different date functions... i think dateadd might work for you here.. <cfset localdate = #date_time#> <cfset localtime = dateadd("d", -7, "#date_time#")> that may or may not work.. i'm just throwing it out there
Jamie18 is spot on. Just use "h" (for hour) instead. <cfset localtime = dateadd("h", -7, date_time)> Code (markup):
I knew it was simply, I didnt have all the parts in the right areas. I did a lot of searching all night but I think my brain was fried. Thanks, we are on our way to globalization!