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: 3
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: 669
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! :)