Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Change the timestamps of each article by 8 hours
For usability in the admin interface, I have a site that I need to change the timestamps (posted, expiry and modified) on every article. This is to be done in conjunction with a timezone change in the preferences, the idea being that Textpattern is a new timezone and the articles have their timestamps bumped by the difference, so they cancel one another out.
The reasoning behind it is expiry dates. I am using more expiry dates in PDT, but I’m posting in GMT currently. Rather than mentally do the sums for timezone offsets, I figure the safest way is to switch the timezone and push the timestamps up. Is there a way I can do this at database or plugin level?
Thank you in advance.
Offline
Offline
Re: Change the timestamps of each article by 8 hours
Hi Pete, if you need to do for future or for posted, you can use mck_time plugin;
For future
<txp:mck_time start="expires" time="8 hours" format="%H:%M" />
For posted
<txp:mck_time start="posted" time="8 hours" format="%H:%M" />
Last edited by MarcoK (2012-10-18 10:40:51)
Offline
Re: Change the timestamps of each article by 8 hours
MarcoK wrote:
Hi Pete, if you need to do for future or for posted, you can use mck_time plugin
Interesting. But it does not really modify dates, right, so the articles will expire too early/late anyway?
Such a plugin would be much easier to write if you voted for my call :)
Offline
Re: Change the timestamps of each article by 8 hours
etc wrote:
Hi Pete, if you need to do it for future articles too, maybe MySQL TRIGGER could help you?
Thanks, Oleg – good find, thank you. I think what I’m going to do is leave the timestamps as they are, but see if I can apply an offset to the posted
output so I can kludge the output to the browser.
MarcoK write:
Hi Pete, if you need to do for future or for posted, you can use mck_time plugin;
Huh, that looks interesting, thank you — I will check it out!
Offline
Re: Change the timestamps of each article by 8 hours
etc wrote:
Interesting. But it does not really modify dates, right, so the articles will expire too early/late anyway?
Yeah! It will modify only the output date.
Offline
Re: Change the timestamps of each article by 8 hours
MarcoK wrote:
Yeah! It will modify only the output date.
This is exactly what I’m looking for. Thanks, Marco.
Update: installed, implemented — working! I’ve credited you here, Marco, I hope that’s OK.
Last edited by gaekwad (2012-10-18 11:23:20)
Offline
Re: Change the timestamps of each article by 8 hours
Sure!!!
Thanks!
Offline