July 23, 2004

MT Time Stamps and PHP

Messed around with the dates the other day. I didn't like seeing just the vanilla date, and wanted something a little more. After looking around, I found <a href="http://www.rattledbaby.com/archives/000244.php">some interesting options</a> that have already been implemented by people.

I found <a href="http://blog.natbat.co.uk/archive/2003/Jun/14/time_since">NatBat's method</a> to work just about like I want it. And it seems the code is easy enough to monkey with, so I'll probably try and do that later.

My biggest problem is I was having a braindump yesterday on how to get the MT variables read into PHP. Then I remembered that the CGI is parsed <em>before</em> the PHP, so all I had to do was escape the characters. <? echo time_since('<$MTEntryDate format="%x"$>'); ?> worked just great.

UPDATE: Something is goofy. The time countdown isn't working too terribly great, it's off somehow. I'll be looking more into it this weekend.

Post Info

Tagged As MT

Comments are Open (0)

Posted at 07:11 AM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Search
Comments on this post
Categories
Info
Tony Stephens
Copyright © 1995-2005
Site Version:
10
Licensed:
Creative Commons
Validate:
XHTML, CSS, 508, RSS
Subscribe
Blog-Fu, Link-Fu