Hello,
I would like to ask if it's possible to extract the capture date (the creation date) of an image from the EXIF information using XnView or XnView MP and insert it into IPTC (keywords, in the format: year, month, day -> xxxx.xx.xx)?
thx
How to Write Exif (date of capture) to IPTC (keywords)
Moderator: xnview
-
megapascal
- Posts: 5
- Joined: Thu Feb 19, 2026 12:18 pm
-
mopperle
- Posts: 2
- Joined: Thu Feb 19, 2026 3:09 pm
-
jkm
- Posts: 412
- Joined: Sat May 11, 2024 12:43 am
Re: How to Write Exif (date of capture) to IPTC (keywords)
Welcome to the forums.megapascal wrote: Thu Feb 19, 2026 12:27 pm I would like to ask if it's possible to extract the capture date (the creation date) of an image from the EXIF information using XnView or XnView MP and insert it into IPTC (keywords, in the format: year, month, day -> xxxx.xx.xx)?
Yes, it is possible.
You can use Tools->Batch Convert.
In the Actions tab, add a Metadata/IPTC action. Then in the Keywords section for that action, add:
{exif:date taken [Y.m.d]}
Make sure to hit enter after pasting in the above text, so it is added to the list below the entry field.
That will use the "Date Taken" field, and the exact date format you specified in your post. You can use a different field or format as needed. The capture date (which in Exif terms would be "Date Taken" or "Date Digitized") is not necessarily the same as the creation date of the file.
Hopefully this helps. Good luck...
-
megapascal
- Posts: 5
- Joined: Thu Feb 19, 2026 12:18 pm
Re: How to Write Exif (date of capture) to IPTC (keywords)
It works great!! Thank you so much.
Now I can buy the app.
Now I can buy the app.
-
jkm
- Posts: 412
- Joined: Sat May 11, 2024 12:43 am
Re: How to Write Exif (date of capture) to IPTC (keywords)
You’re very welcome.
-
megapascal
- Posts: 5
- Joined: Thu Feb 19, 2026 12:18 pm
Re: How to Write Exif (date of capture) to IPTC (keywords)
@jkm
I was too optimistic yesterday. This method saves the creation date as a keyword in the correct location, but it creates copies of the original images. This results in JPG compression being applied twice, which means a loss of image quality.
Is there a way to copy/paste the creation date from EXIF into IPTC within the same image without altering the image data?
I was too optimistic yesterday. This method saves the creation date as a keyword in the correct location, but it creates copies of the original images. This results in JPG compression being applied twice, which means a loss of image quality.
Is there a way to copy/paste the creation date from EXIF into IPTC within the same image without altering the image data?
-
jkm
- Posts: 412
- Joined: Sat May 11, 2024 12:43 am
Re: How to Write Exif (date of capture) to IPTC (keywords)
Sure, it is still possible.
If you're running v1.9.10 (this functionality is being improved) then you can use the function Metadata->Edit Metadata. (This function will renamed in an upcoming version.)
This will present you a small dialog, and you click Add and select IPTC:Keywords from the menu.
Then, in the entry field, paste the same string I gave you before: {exif:date taken [Y.m.d]} You'll also see you can select different metadata variables by clicking the little right-arrow button next to the entry field. You will see this button next to entry fields in many places in the app.
When you click Write, it will write the selected metadata to the file, but will not alter the image data. So no loss of quality for jpeg, but no other changes possible either. This will modify your original image files, so be forewarned. Make backup copies beforehand if you prefer.
You can do this to multiple files at the same time by selecting them all before the running Edit Metadata. If you use a variable string (as above) it will insert the appropriate value for each file. If you use a literal string, like "Birthday", it will insert the same metadata into all files.
That is an easy way to simply inject new metadata into some files, although it is somewhat simplistic and not interactive.
You can also achieve the same result using the enormously more complicated Metadata->Edit IPTC dialog. When adding or editing keywords in that dialog (the 2nd tab named, obviously, Keywords) using variables like {exif:date taken} is also possible. When using this functionality, you need to be aware of your IPTC/XMP Mode, which is specified on the Options page of that dialog. This allows you to encapsulate IPTC in XMP, or not, or write both. Then there's also your sidecar file mode to consider. It's a bit complicated, so if you don't understand it I'd suggest avoiding this dialog for now.
Lastly, after doing any of these things to write new metadata, you may need to select the files and do a "Metadata->Update Catalog from files" in order for the new metadata to appear in some of the XnViewMP dialogs or areas. But generally, if you re-select the image and go to the Exiftool tab, you should see the new metadata that is in the file, even if it does not appear in the Edit IPTC dialog (yet).
As I said, the metadata functionality in XnViewMP is something that is currently in a process of improvement. Many updates have been recently made and are available in the 1.9.10 version, and more improvements are coming, so it's not a static situation at the moment.
If you're running v1.9.10 (this functionality is being improved) then you can use the function Metadata->Edit Metadata. (This function will renamed in an upcoming version.)
This will present you a small dialog, and you click Add and select IPTC:Keywords from the menu.
Then, in the entry field, paste the same string I gave you before: {exif:date taken [Y.m.d]} You'll also see you can select different metadata variables by clicking the little right-arrow button next to the entry field. You will see this button next to entry fields in many places in the app.
When you click Write, it will write the selected metadata to the file, but will not alter the image data. So no loss of quality for jpeg, but no other changes possible either. This will modify your original image files, so be forewarned. Make backup copies beforehand if you prefer.
You can do this to multiple files at the same time by selecting them all before the running Edit Metadata. If you use a variable string (as above) it will insert the appropriate value for each file. If you use a literal string, like "Birthday", it will insert the same metadata into all files.
That is an easy way to simply inject new metadata into some files, although it is somewhat simplistic and not interactive.
You can also achieve the same result using the enormously more complicated Metadata->Edit IPTC dialog. When adding or editing keywords in that dialog (the 2nd tab named, obviously, Keywords) using variables like {exif:date taken} is also possible. When using this functionality, you need to be aware of your IPTC/XMP Mode, which is specified on the Options page of that dialog. This allows you to encapsulate IPTC in XMP, or not, or write both. Then there's also your sidecar file mode to consider. It's a bit complicated, so if you don't understand it I'd suggest avoiding this dialog for now.
Lastly, after doing any of these things to write new metadata, you may need to select the files and do a "Metadata->Update Catalog from files" in order for the new metadata to appear in some of the XnViewMP dialogs or areas. But generally, if you re-select the image and go to the Exiftool tab, you should see the new metadata that is in the file, even if it does not appear in the Edit IPTC dialog (yet).
As I said, the metadata functionality in XnViewMP is something that is currently in a process of improvement. Many updates have been recently made and are available in the 1.9.10 version, and more improvements are coming, so it's not a static situation at the moment.
-
megapascal
- Posts: 5
- Joined: Thu Feb 19, 2026 12:18 pm
Re: How to Write Exif (date of capture) to IPTC (keywords)
Thanks for the information and your support.
Your tip works well. You just need to know what each command does.
There's a big bug in the function Metadata > Edit Metadata -> IPTC -> {exif:date taken [Y.m.d]}
but the creation date is inserted as a keyword, BUT ALL EXISTING KEYWORDS ARE DELETED!
See pictures. IPTC1.jpg was inserted before the keyword. IPTC1.jpg was inserted after.
How do I prevent this?
In batch converting, the existing keywords are retained after conversion, and the creation date is added correctly.
Your tip works well. You just need to know what each command does.
There's a big bug in the function Metadata > Edit Metadata -> IPTC -> {exif:date taken [Y.m.d]}
but the creation date is inserted as a keyword, BUT ALL EXISTING KEYWORDS ARE DELETED!
See pictures. IPTC1.jpg was inserted before the keyword. IPTC1.jpg was inserted after.
How do I prevent this?
In batch converting, the existing keywords are retained after conversion, and the creation date is added correctly.
You do not have the required permissions to view the files attached to this post.
-
jkm
- Posts: 412
- Joined: Sat May 11, 2024 12:43 am
Re: How to Write Exif (date of capture) to IPTC (keywords)
Thanks. I appreciate the thoughtfulness of your replies and patience in working through things. The app can be complicated when you’re starting out, so patience and thoroughness are necessary.megapascal wrote: Sat Feb 21, 2026 2:03 pm Thanks for the information and your support.
Your tip works well. You just need to know what each command does.
It's not really a bug in functionality, just in naming (and therefore expectations). This is why I mentioned v1.9.10.megapascal wrote: Sat Feb 21, 2026 2:03 pm There's a big bug in the function Metadata > Edit Metadata -> IPTC -> {exif:date taken [Y.m.d]}
but the creation date is inserted as a keyword, BUT ALL EXISTING KEYWORDS ARE DELETED!
See pictures. IPTC1.jpg was inserted before the keyword. IPTC1.jpg was inserted after.
How do I prevent this?
The function you're referencing is badly named in the version you are using. It will be re-named in the upcoming version to "Add/Replace Metadata" which is what it actually does. You didn't say before you had existing keywords you wanted to preserve... That function doesn't "Edit". It Adds or Replaces only; it Overwrites. Which is why it's getting renamed.
If you want to be able to edit the list of keywords (meaning generally preserve what is already there while making additions or individual deletions) without using batch convert then unfortunately you will have to use either the aforementioned Edit IPTC or Edit XMP.
I had wanted to avoid steering you to that function for several reasons:
1. It's confusing and complicated to use properly, and so you will almost certainly make mistakes; everyone does.
2. I didn't want to have to explain it.
3. There are some bugs in it.
4. A review and improvement of that functionality is pending, so the above may change soon. Hopefully it will be better in the near future.
Right now you can't use “Edit IPTC” because it has a bug where evaluation of variables like {EXIF:Date Taken} is broken in the Edit IPTC dialog.
However, it is possible to edit IPTC keywords using the Edit XMP dialog. Because XnViewMP is complicated and tricksy.
If you are brave enough to attempt it, and also cruel enough to force me to explain it, we could try...
You would need to tell me several things:
1. Do you use sidecar files? (like for XMP data or for compatibility with Adobe products that use sidecars)
2. Are your existing keywords that you want to maintain IPTC or XMP keywords? (Technically, in XMP they are called Subjects)
3. Are you using XMP Hierarchical Subject for anything? (Separate from regular Subject (keywords). If you know nothing about this, then probably you are not.)
4. Are you otherwise using XMP metadata?
5. What's the file format (jpeg, gif, what) that you're trying to operate on?
6. I'd like you to attach (or otherwise post somewhere) a sample file (before editing) that has some of your existing keywords so I can evaluate. I don't want surprises halfway through.
Lastly, there is a limitation to this approach of using Edit XMP to modify the IPTC keywords: it will write the same data to both IPTC and XMP. So if you have existing XMP Subjects/Keywords that you want to maintain and that have to be DIFFERENT from the IPTC keywords, then we can't use this approach. So if this limitation is a problem for you, then you will just have to wait until Edit IPTC is fixed.
If at this point, you're thinking things like "That sounds tricky. Why is it so complicated?" then you are showing good sense. Partly it's because supporting arbitrary metadata of different formats that have evolved over decades across a wide array of file types is inherently complicated and difficult; and partly it's because XnViewMP is not as good at this as it could/should be. But improvements are being made. Pierre the developer is very conscientious about wanting to improve the app, but there are always competing priorities and sometimes things take time. I generally don't like to publicly say much about what's coming or when, but for improvements in this area I think it's probably more like days/weeks rather than months/years, so you can decide if you'd rather wait or try to plough ahead. Improvements to batch processing, so that you can do something like the "Batch Convert" approach without recompression, will also be considered.
UPDATE: I'm pleased to be able to say the bug in the Edit IPTC dialog that prevented variable evaluation has been quickly fixed (Thanks Pierre!) for the upcoming release, so if you wait a few days, you'll be able to use Edit IPTC instead of Edit XMP, which will make things just a bit less complicated. (#3,4 above become moot)
Last edited by jkm on Mon Feb 23, 2026 11:22 pm, edited 1 time in total.
-
megapascal
- Posts: 5
- Joined: Thu Feb 19, 2026 12:18 pm
Re: How to Write Exif (date of capture) to IPTC (keywords)
Sorry for calling the keyword overwriting a mistake. I assumed it was a given that the existing keywords wouldn't be overwritten. My error.
I've done some research, and Exiftool is indeed a very complex tool. I now understand why implementing all the requirements in XnViewMP is so difficult.
I've run a few tests.
In XnViewMP, the command {EXIF:Date Taken} writes the date in the wrong place. See the screenshot "02 - edited metadata with xnviewmp.jpg". Here, "camera manufacturer" is written to EXIF.
I'm using Geosetter to write GPS data into the images. At the same time, the country, country code, state, city, and town are correctly written in both IPTC and XMP. See images 3-5.
Then you can use Exiftool with the following command:
All four images and the screenshot can be downloaded here.
Thank you very much for your time and comprehensive explanation.
I've done some research, and Exiftool is indeed a very complex tool. I now understand why implementing all the requirements in XnViewMP is so difficult.
I've run a few tests.
In XnViewMP, the command {EXIF:Date Taken} writes the date in the wrong place. See the screenshot "02 - edited metadata with xnviewmp.jpg". Here, "camera manufacturer" is written to EXIF.
I'm using Geosetter to write GPS data into the images. At the same time, the country, country code, state, city, and town are correctly written in both IPTC and XMP. See images 3-5.
Then you can use Exiftool with the following command:
This writes the creation date to IPTC, but not to XMP. Lightroom Classic can definitely read it and interprets the data as a keyword.exiftool -overwrite_original -if "$EXIF:DateTimeOriginal" -d "%Y.%m.%d" "-IPTC:Keywords<EXIF:DateTimeOriginal" -IPTC:Keywords+= xxxxxx.jpg
All four images and the screenshot can be downloaded here.
Thank you very much for your time and comprehensive explanation.
You do not have the required permissions to view the files attached to this post.
-
jkm
- Posts: 412
- Joined: Sat May 11, 2024 12:43 am
Re: How to Write Exif (date of capture) to IPTC (keywords)
Don't worry.megapascal wrote: Mon Feb 23, 2026 3:12 pm Sorry for calling the keyword overwriting a mistake. I assumed it was a given that the existing keywords wouldn't be overwritten. My error.
It seems you're going on to a different topic here, Exiftool. I'm confused as to the goal now.megapascal wrote: Mon Feb 23, 2026 3:12 pm I've done some research, and Exiftool is indeed a very complex tool. I now understand why implementing all the requirements in XnViewMP is so difficult.
I've run a few tests.
Your use of language is a bit confusing here. {EXIF:Date Taken} is not a command, it is data that can be written. "Camera Manufacturer" wasn't "written to EXIF" it was "written to, in EXIF". It's actually a date that was "written to EXIF". But with the screenshot I think I see what you mean.megapascal wrote: Mon Feb 23, 2026 3:12 pm In XnViewMP, the command {EXIF:Date Taken} writes the date in the wrong place. See the screenshot "02 - edited metadata with xnviewmp.jpg". Here, "camera manufacturer" is written to EXIF.
I see in your screenshot that somehow you wrote a date/time into the Camera Manufacturer field. I don't know actions you did to do that.
I tested using "Edit Metadata" to write Exif:Date Taken and the correct field in the file, EXIF:Date Taken, was updated with a date/time.
I also tested using Edit Metadata to write to the IPTC:Keywords field with the value {Exif:Date Taken} and again it worked correctly.
You think XnViewMP "writes the date in the wrong place" but I could not reproduce that.
I can try and help you, but I need to know exactly what you did.
Please provide the EXACT STEPS you did in XnViewMP to get your bad result (screenshot 2).
By the way, the bug I mentioned in the Edit IPTC dialog is fixed in the just released version 1.10.1