Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
JMM
Experienced
Topic Author
Posts: 216
Joined: 02 Aug 2021, 11:18

EXIF in X3 shows wrong timezone

14 Dec 2025, 03:32

Hello, all,

Has anyone run into the problem of EXIF in X3 showing the wrong timezone?

I have a picture that has the creation time set as being 12:34:56 in the timezone of Hawaii, which is UTC-10:00.
  • Date created: 1986-05-23
  • Time created: 12:34:56 UTC -10:00
However, X3 is incorrectly showing:
  • 1986-05-23T12:34:56-04:00
X3 is displaying the correct date & correct time, it's just the timezone that is wrong.

I think the problem is that I (and my X3 website) are located in the Eastern timezone (EST/EDT, which for my location is UTC-05:00 during Standard Time, and UTC-04:00 during Daylight Savings Time).  So a month of May (05) for my location would be during Daylight Savings Time, which would be UTC-04:00.

It seems that the EXIF in X3 is picking up the correct time from that JPG file, but is incorrectly displaying the timezone on my website's location, instead of the timezone actually embedded in the picture.

Is this a bug in X3, or am I missing something?

Thanks in advance.

John
 
User avatar
JMM
Experienced
Topic Author
Posts: 216
Joined: 02 Aug 2021, 11:18

Re: EXIF in X3 shows wrong timezone

14 Dec 2025, 03:37

I don't know if this is causing the problem or not, but in my PHP.ini file, I have my timezone set as:

Code
date.timezone = America/Toronto
... which in May would be UTC-04:00
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: EXIF in X3 shows wrong timezone

15 Dec 2025, 02:34

Hi John,

Sorry for the late reply. Dates with timezone offsets are clumsy to work with.
JMM wrote: However, X3 is incorrectly showing:
  • 1986-05-23T12:34:56-04:00
Could you show me where X3 is showing this? X3 doesn't show timezone offsets like that by default. And do you have a direct link to the image so I can take a look? Also, image EXIF doesn't really store timezone, so I'm not sure where you are getting the "correct values from". As google says:
Google wrote:EXIF data for the date taken (DateTimeOriginal) typically stores a "naive" local time without timezone info, but newer standards (EXIF 2.31+) can include an OffsetTimeOriginal tag for the UTC offset, though many cameras and software still don't use or properly handle these tags, leading to ambiguity.
There is image date, image time zone, server time, server timezone, client (browser) time and client timezone. In X3, we generally calculate image time relative to client time, so we know when the image was taken compared to client time. I was working with the logic in Files Gallery, and I think this discussion and post sums up the challenge:
https://forum.files.gallery/d/94-photo- ... imezone/34

(You can scroll up to read the entire debate if you want)
 
User avatar
JMM
Experienced
Topic Author
Posts: 216
Joined: 02 Aug 2021, 11:18

Re: EXIF in X3 shows wrong timezone

15 Dec 2025, 09:41

Thanks for getting back to me.

I had used the wrong wording in my initial post; I had said that X3 is displaying the timezone, when I should've said that X3 is displaying the UTC offset.  My apologies.

But I've found the problem.  In my PHP.ini file, I have my timezone set to:

Code
date.timezone = America/Toronto
So for any pictures with EXIF information, and in particular date/time information, X3 appends the UTC offset for those pictures that corresponds to the timezone set in my PHP.ini file, regardless of any timezone defined in the picture's EXIF information.

The specific picture that caused me to start investigating this issue, has a creation date/time set to be (as stated in my original post):
  • Date created: 1986-05-23
  • Time created: 12:34:56 UTC -10:00
THIS link shows the creation date 4 times with timecreated being 12:34:56-10:00 

As for what X3 displays, with my date.timezone in my PHP.ini file set to America/Toronto, X3 displays the date/time in that picture's EXIF information as being:
  • 1986-05-23T12:34:56-04:00
If I change my date.timezone in my PHP.ini file to Europe/Paris, X3 displays the date/time in that picture's EXIF information as being:
  • 1986-05-23T12:34:56+02:00
If I change my date.timezone in my PHP.ini file to Asia/Bangkok, X3 displays the date/time in that picture's EXIF information as being:
  • 1986-05-23T12:34:56+07:00
The date & time remain the same... it's just the UTC offset that changes in what X3 displays, depending on the date.timezone in my PHP.ini file.

If X3 is going to display any UTC offset, I feel that it should display the offset that is embedded in the picture's EXIF information, if that offset is present.

Instead of X3 always displaying incorrect UTC offsets, is there a way that I can have X3 not display the UTC offset at all?

Thanks in advance.

Regards,
John
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: EXIF in X3 shows wrong timezone

15 Dec 2025, 20:42

First of all, I see image data in that, but I don't see any link or information about where this image is displaying in X3.
JMM wrote:regardless of any timezone defined in the picture's EXIF information.
There is no timezone defined in the picture EXIf info.

Basically, you have an image, without timezone, which X3 needs to create a time object from. So it creates the time object, relative to the server time (what other reference should we use?). And then, you clearly have some specific time output settings in your X3, where you are asking to output TIMEZONE. Yet your image doesn't come with timezone info. Surely this won't work properly?
 
User avatar
JMM
Experienced
Topic Author
Posts: 216
Joined: 02 Aug 2021, 11:18

Re: EXIF in X3 shows wrong timezone

16 Dec 2025, 23:20

mjau-mjau wrote: First of all, I see image data in that, but I don't see any link or information about where this image is displaying in X3.
https://x3.nitrowings.me/test_galleries/forum_questions/exif_time_offset_incorrect/

Each of the 3 colour images (on the left) show a date/time in the displayed EXIF line, with a false incorrect time offset displayed of -04:00 (for the 2 pictures that were taken during the summer months), or -05:00 (for the 1 picture taken during the winter months).
mjau-mjau wrote: There is no timezone defined in the picture EXIF info.
Click on each of the 3 images on the right.  Note that inside each of those pictures' EXIF information, there are UTC-offsets.  Not timezones, as I already said previously that I had initially used the wrong wording (I had said timezone, when I should've called them offsets).

I assume that quite likely, the field that X3 uses to determine the date/time that pictures are taken does not contain any UTC-offset value.  Accepted.  But as that field contains no UTC-offset value, then X3 should NOT be displaying a UTC-offset at all.  Period.
mjau-mjau wrote: Basically, you have an image, without timezone, which X3 needs to create a time object from. So it creates the time object, relative to the server time (what other reference should we use?).
Therein lies the problem.  If X3 does not find a UTC-offset, when X3 creates the time object, why include a false UTC-offset at all, based on the server time?  If the UTC-offsets are based on the server's UTC-offset, they could be false 100% of the time.

My complaint is not that X3 is not picking up the UTC-offset from the EXIF information... it is that X3 is displaying information that does not exist... false information.

I was just trying to point out that there is a problem with what X3 is displaying.  If you feel that X3 giving false information is not a problem, sobeit.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: EXIF in X3 shows wrong timezone

17 Dec 2025, 22:37

You know, you are probably right. Currently, it seems you have enabled a feature that is disabled by default (display time with timezone format). I can't quite remember the entire process here, but in X3 we need to first get the time and convert it into a time object, and then it's used to create "timeago" output (eg "three days ago ..."). For this to work, we need to convert the time relative to client time (browser), and then this data needs to be read into X3 from the image and server, both potentially with their own times. As you can guess, it's dodgy. In the end, you are displaying a time that has first been converted from image exif > server > PHP > Javascript > client time, and then output in browser again.

I will look into it when I get around to doing an update. In the mean time, this is not critical because it's a disabled feature by default.