How to copy date into plain-text field?

Ask for help and post your question on how to use XnView MP.

Moderator: xnview

turtle
Posts: 5
Joined: Tue Aug 04, 2026 4:51 pm

How to copy date into plain-text field?

Post by turtle »

How can I copy a date (such as Created, Modified or Encoded) into a text field such as Caption or Comment? I want them in a non-date text field where they won't be treated as dates. I just want all the numbers and letters to look like a date to you and me but I do not - repeat, do NOT - want Windows to treat them as dates as it normally does with Created/Accessed/Modified.

It has to be one of the following date fields. In the right-hand Info panel some appear under Properties tab and some under ExifTool.

Created date (or "Creation date/time", "File Created Date" or "File: Create date"; all these variations appear in XNView and I have no idea if they're referring to the same field or four different ones!)
Modified date (aka Modified date/time, also may have other variant names)
Encoded date
Date/Time Original
Create Date (totally different field from Created date)

And -

If it's Created Date or Modified date, I also need it converted from mm/dd/yyyy hh:mm:ss AM/PM to yyyy-mm-dd hh:mm:ss in 24-hour time. I don't care whether the conversion happens in the date field (before copying) or text field (after copying). Note that Created Date and Create Date are two completely separate fields. One's in mm/dd/yyyy hh:mm:ss AM/PM and the other is already yyyy-mm-dd hh:mm:ss 24-hour time.
jkm
Posts: 710
Joined: Sat May 11, 2024 12:43 am

Re: How to copy date into plain-text field?

Post by jkm »

Welcome to the forums, turtle.

I'm not sure this is a question a
turtle wrote: Tue Aug 04, 2026 5:10 pmhighly advanced power user
would be asking as it is relatively simple, but I'll try to point you in the right direction. :wink:

If you're asking about how to do this in XnViewMP, you don't. This is something you would use exiftool for. You could write a script and use XnViewMP to invoke exiftool against a file, but XnViewMP internally does not do the sort of manipulation you're asking for. But it's exactly what Exiftool is designed to do.

If you look at the exiftool documentation, the syntax for copying values from one field to another is simple:

Code: Select all

-[+]TAG[+-]<SRCTAG 
That won't work verbatim, because of course you realize certain special characters have shell-specific meanings and have to be escaped or quoted, so on Windows a working example would look like this:

Code: Select all

exiftool "-xpcomment<datetimeoriginal" filespec
Obviously, that writes the contents of the DateTimeOriginal EXIF field into XPComment for the specified file.

Exiftool can do that sort of thing on multiple fields at once, or recursively for an entire directory tree, etc.

If you need further advice on Exiftool syntax to achieve another specific result, I suggest you post your question on the Exiftool forums. That's what they're there for. They might tell you to read the documentation or check the FAQ, but if you get into something tricky there are very knowledgeable people there, and Phil might even respond himself.

Hopefully this helps... Good luck! :)
turtle
Posts: 5
Joined: Tue Aug 04, 2026 4:51 pm

Re: How to copy date into plain-text field?

Post by turtle »

jkm wrote: Tue Aug 04, 2026 7:45 pm If you're asking about how to do this in XnViewMP, you don't.
I believe you but why doesn't this work?

Metadata > Edit Metadata > Add > [Description, Annotation or some other text field] > click on arrow, go through field lists and add any of various dates in the menus

It's called "Edit Metadata" and you insert fields which sounds like exactly what I want to do.
jkm
Posts: 710
Joined: Sat May 11, 2024 12:43 am

Re: How to copy date into plain-text field?

Post by jkm »

You must be using an old version of XnViewMP. That function was renamed some time ago to "Add/Replace Metadata". But I'm puzzled; if you you knew about it and thought it met your needs, why the original post? Why didn't you just use it?

I assumed the point of your question was that that sort of function wasn't flexible enough for you. Only certain fields are accessible from the menu, and only certain types of formatting can be done, and only for certain types of data. With Exiftool, you don't have those limitations: you can access any field, and massage it as necessary to write it into the text field of your choice. Perhaps I was in error thinking you had that knowledge of the application and had done some basic experimentation. I guess I should have explicitly asked if you'd tried it, instead of inferring you had and that you'd found it lacking.

If your needs are simple enough that the built-in functions can satisfy you, then by all means use it. Try it and see.

It's unclear what you're trying to avoid when you say you don't want Windows to "treat them as dates". Windows doesn't "treat" your images any particular way or do anything to them unless you tell it to. You said in another thread you had some confusion about the various date fields. Some people copy certain fields into new "backup" fields for archival purposes, which makes sense in some circumstances, but generally it is helpful to have data like dates be in a recognized format so that when you do want to do something with it, that's easy to do.

Edit: Upon re-reading your original post, it seems that you do have some confusion about the meaning of the date fields and what they are for. If you want to learn from definitive sources, you might want to consider reading CIPA's document publishing the EXIF specification, which is the definition of the fields that everyone else works from. You can access it here: https://www.cipa.jp/std/documents/downl ... ion-2023-E I assume you have an understanding of file system metadata, and it's just the EXIF data that is troubling you.