Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2026-07-14 13:57:18

etc
Developer
Registered: 2010-11-11
Posts: 5,729
Website GitHub

Re: [solved] Date posted puzzlement

Another massive 4.9.2 rewrite, please test.

Offline

#17 2026-07-14 17:31:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,617
Website GitHub

Re: [solved] Date posted puzzlement

Wow, that’s a huge alteration, but fabulous it’s now compartmentalised. Should.make it far easier to make changes if there’s any tweaks needed. Nice work.

Is there any mileage in making our own DateTime (for example) class that encapsulates the new functions and safe_strftime(), etc? Or is it better to keep it as a function for speed?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#18 Yesterday 11:43:35

etc
Developer
Registered: 2010-11-11
Posts: 5,729
Website GitHub

Re: [solved] Date posted puzzlement

Bloke wrote #343496:

Is there any mileage in making our own DateTime (for example) class that encapsulates the new functions and safe_strftime(), etc? Or is it better to keep it as a function for speed?

I do not think this would make a big difference. One of the advantages of the classes is loading on demand, thus sparing some memory when a class is not required (we do it for some less-used tags). But date/time functions are used on almost all pages, so we would not improve anything performance-wise by implementing a new class.

The main question atm is whether everything date-related works ok now, in each db version.

Offline

#19 Today 06:09:30

phiw13
Plugin Author
From: East Asia
Registered: 2004-02-27
Posts: 3,712
Website

Re: [solved] Date posted puzzlement

etc wrote #343499:

The main question atm is whether everything date-related works ok now, in each db version.

So far I didn’t have any issue (date & time set as expected when authoring (creating and editing) an article, when checking past articles (admin side and public side). Idem for Images.

Tested

  • locally, PHP 8.5.x, MySQL 8.4.x
  • Singapore based server: PHP 8.5.x, MySQL: 8.4.10-10 (Percona Server (GPL), Release 10, Revision d76e81f4)

There is one hour timezone difference between me and the Singapore server.


In low-power mode.
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#20 Today 10:21:45

etc
Developer
Registered: 2010-11-11
Posts: 5,729
Website GitHub

Re: [solved] Date posted puzzlement

phiw13 wrote #343507:

So far I didn’t have any issue (date & time set as expected when authoring (creating and editing) an article, when checking past articles (admin side and public side). Idem for Images.

Thanks, glad to read it, especially if the performance is not affected (at least for the unix epoch dates). Have you also tried pre/post-unix dates, which was the whole point?

Offline

#21 Today 11:14:11

phiw13
Plugin Author
From: East Asia
Registered: 2004-02-27
Posts: 3,712
Website

Re: [solved] Date posted puzzlement

etc wrote #343510:

Thanks, glad to read it, especially if the performance is not affected (at least for the unix epoch dates). Have you also tried pre/post-unix dates, which was the whole point?

I didn’t see any performance issues, bearing in mind both test are done on low traffic sites. Saving was working as fast as before.

I have a couple of test articles with dates going back to 1650CE (posted date), the article list panel loads and sorts them as expected. I did not create new articles and set the date to some glorious pre-unix time.


In low-power mode.
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#22 Today 11:26:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,617
Website GitHub

Re: [solved] Date posted puzzlement

I’m away from the laptop at the moment but I’ll grab the latest dev code and test some dates and article saving later.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB