Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: changing image Date added
Bloke wrote #341229:
Gotcha, thanks. Mine’s different, for some reason. If I enter the date and time in the Images panel, what’s actually stored is the timestamp an hour later. And that’s the same if I do it on a live site (server in Germany) or on localhost.
What are the timezones of the databases (localhost / DE host) – in Diagnostics, I see 4 Database server time entries. For time zone, on all 3 DB’s I checked the value is SYSTEM and Database server time show current time on the file system hosting the DB (remote servers are both UTC).
Edit
If you output the Published date of the image in an article (I used <txp:image_date/> ) does that matches what the Images panel says, or the database time?
Last edited by phiw13 (Yesterday 09:32:39)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: changing image Date added
My diagnostics are posted above. They’re mostly identical, except the timezones. Which is why it’s even more baffling that the two systems behave the same, leading me to believe TZ is not the only factor in play.
I’ll run some more tests later if I get a chance.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: changing image Date added
phiw13 wrote #341225:
For UTC: shown as UTC time (9 hours off)
Wait, do I get it right that
the MySQL DB time ([is] set to OS time – JPN standard. UTC – 9),
but when you save an article with txp pref set to UTC, the db Posted field (inspected via some db manager) is saved as UTC date? That would be weird, the db date should always correspond to the db time zone, whatever txp tz is selected.
I played a little with a TXP-4.9RC. If I set the time zone pref to Paris (UTC-1), everything works fine. The DB datetime is shown as Japan time, Posted and Modified dates are the correct Paris time.
This is how it should work.
Then Hong Kong or Singapore (UTC-8). The DB time is one hour off (10am is shown as 9am), the Posted and Modified dates are 2 hours off, shown as 8am, double conversion.
Is db Posted time one our off Japan or Singapore time? It should always stay Japan.
It is odd as locally the date as shown on the pref pane (date format, Archived date format) are always correct.
This, at least, is a sign that safe_strftime() works correctly, and the problem lies somewhere between txp and db time conversion.
Offline
Re: changing image Date added
There was, though, a quirk concerning LastMod and ‘Reset timestamp to now’ in cf branch, but dev shouldn’t be concerned.
I have also patched(?) the inconsistency between date() and intl for pre-Gregorian dates, with one exception: dates from 1582-10-05 to 1582-10-14 have been skipped on cutover and are invalid for intl, but valid for date. So, 1582-10-05 UTC will be output as is by date(), but as 1582-10-15 if passed through intl. Avoid using this range, for consistency.
Offline
Re: changing image Date added
etc wrote #341236:
but when you save an article with txp pref set to
UTC, the dbPostedfield (inspected via some db manager) is saved as UTC date?
Indeed that is it.
Is db
Postedtime one our off Japan or Singapore time? It should always stay Japan.
The DB time is the literal Singapore time, one hour of from the Japan time. That is wrong based on my localhost DB config, as you note.
This, at least, is a sign that
safe_strftime()works correctly, and the problem lies somewhere between txp and db time conversion.
The problem I cannot test is if this is a PHP 8.4.latest issue, or something locally. The Hong Kong hosted site I have runs PHP 8.4, but I cannot play and mess things up there. Live site and all that.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#42 Today 03:18:38
Re: changing image Date added
etc wrote #341237:
There was, though, a quirk concerning
LastModand ‘Reset timestamp to now’ in cf branch, but dev shouldn’t be concerned.
Test with the CF branch: Singapore, Paris and UTC time zones: article posted and modified dates are now correct, as is the DB time.
(I will review/retest what happens with the 4.9-dev setup later)
The date widget for images is great now.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline