Simon Griffee
Design consulting, art direction, photography.

April 2005


Published 2005 April 13

I looked at the sky today. I looked at the sky. Blue. Yellow and gray. White. Blue clouds. Storm front coming in. Like a triangle, falling down on the land. The trees. The green green trees, light green. Spring leaves. Against the blue and gray clouds. White clouds. Afternoon. They spread out, spread out and fell down on the land. Like a triangle. Driving, driving down the road. I wanted to stop. Make a picture. Get that moment. Moments. I looked at the sky.

Textpattern, Strftime Save Daylight Saving Time

I never liked Daylight Saving Time. Losing an hour of sleep before joining the Roman rally-race to work six months of the year made me particularly unhappy.

Freelancing from home means rush-hour traffic is behind me, but Daylight Saving Time (DST) has struck again. This time the gloom was caused by recent birthday-related posts I made to this website, which is powered by Textpattern. The article posted-dates were wrongly displaying as a day previously; for example, an article I had set to be published on April 6th displayed a posted-date of April 5th.

I tracked the problem down to the recent DST change and the absence of a setting for it on the Textpattern site administration panel. Changing the Time Zone setting to GMT+02:00 instead of GMT+01:00 (thus simulating the dreaded DST) worked, but was a hack I wouldn’t want to manually repeat or worry about every six months.

I upgraded to Textpattern RC3 and found that now a setting for DST was available and that it made the posted-dates work properly again. Except now the custom-defined date format on the bottom of each article only showed the PHP date variables instead of an actual day, month and year.

Some Googling brought me to this discussion thread on the helpful Textpattern forum, which gave me the answer. In Textpattern RC3 a new PHP time function called strftime is used to format dates. Strftime formats a local time and date according to locale settings and by using its string format in my txp tags as for example: <txp:posted format="%e %B %Y" /> …my problem was solved. Strftime along with the new Textpattern DST preferences setting saved me yet another Daylight Saving Time woe.

Birthday Boy

Published 2005 April 6

A sepia photograph of dad.

← Notebook Archive