Entries for June 2006

I came across an adobe feature I had never heard of the other day: Adobe Online Tools. You can convert a pdf to either html or text by sending an email with the pdf attached to a specific address, or putting in a url to a form on the website. Its quite handy for when you need to select text out of a pdf. You can access the site here: http://www.adobe.com/products/acrobat/access_onlinetools.html

Posted on Tue. June 06, 2006 by Ryan Guill #
Just a quick note here on a dateDiff() gotcha I came across today. I had two coldfusion timestamp objects, one that was being pulled out of a date field of a database so it comes out as midnight on that date, and one generated using now(). I was wanting to get the difference in days between the two dates. My dates looked like so: Target date: {ts '2006-06-07 00:00:00'} Todays Date: {ts '2006-06-06 00:00:01'} I was calling my date diff like so: What I was noticing was that all of my diffs were coming back a day less than I expected if the target date was in the future and a day more if it was in the past. The reason for this was that even though I was using the datepart "d" for days, it was counting a day as a full 24 hours, not looking at just the date itself. It was also evaluating the time part of the object. Just having one second less than a full 24 hours was subtracting a day (if the target date was in the future). So to get around the issue, I had to make sure that both of the days were only evaluated as date objects not timestamps, which effectivly makes both at midnight for that date. So I whipped up a quick function that I could call to do that for me: Since coldfusion doesnt have a date() function, you could rename this function to that if you want. Im sure there is also something at cflib that will do the same thing but it was just as fast for me to write one that did what I needed. Hopefully this will help someone else in the future.

Posted on Tue. June 06, 2006 by Ryan Guill #
Design, Photograph, Work © Ryan Guill, aDeepBlue 2010: All Rights Reserved. | Contact | RSS Feed