# UI for Selecting Date Time Differences

I'm creating a Windows MFC app in which I can ask the user to select a time difference from years right down to the second from a known time. For the sake of example, let's assume a file's creation date of 2020-11-01 16:00:00.

I could implement this as 6 spin controls to pick the difference, but perhaps this is not the best approach. Each is initialized to 0 and has positive and negative ranges for appropriate values—ie: 0 to 59 and -59 (total of 119 distinct values) for minutes. If I want to change the date & time to a future value like 2020-12-07 17:30:45, I could change each of the spin controls to add 1 month, 6 days, 1 hour, 30 minutes, and 45 seconds. Each part of the date is distinct, so I could add or subtract from each field the necessary amount to each field—ie: changing 2020-01-01 to 2019-12-31 would mean subtracting 1 year, adding 11 months, and adding 30 days.

What I'm not sure about is how most users will perceive time differences where any of those fields have a negative value. For example, if I now want to change 2020-12-01 16:00:00 to 2020-12-01 15:00:00 (ie: an hour fall back to account for DST change), it is easy enough to select -1 hours.

If I want to subtract a total of 1 hour, 23 minutes, and 45 seconds, should I be picking -1 hour, -23 minutes, -45 seconds or should I assume that as soon as a negative value is picked, the ranges for the following ones are changed to positive values only and assume they are to be concatenated to that negative value; that is to say, does picking -1 hour and 1 minute (positive) imply substracting 1:01:00 from a given time or would that be construed as a convenience factor of subtracting 1 hour but adding back 1 minute for a net effect of subtracting 59 minutes? It takes less effort to pick +1 from minutes rather than having to click 59 times down on minutes to -59 or (or click and hold once) to accelerate values.

I'm assuming MFC's spin control has an "acceleration" value where, if I click and hold on 0, it will accelerate through my acceleration value of 10 to get to 10, 20, 30, etc (or 5 for 5, 10, 15, 20, 25, etc.). (or negative if I'm holding down oh the down arrow), but I haven't coded that yet pending responses I get here.

Anyway, the bottom line is I want to adjust dates and times from a known value. I hope my explanation doesn't add to the confusion, but I'll leave it to my fellow software developers to let me know their approach to this. Thanks!

• In double-diamond terms, you have clearly delved into the solution space, but it is unclear from your question what is the problem space. That is, what is the greater context of this problem and what users might actually want to do - what is their task? You speak about "selecting time difference", but sometimes in timestamp terms (-59..59 minutes), sometimes in delta terms (237 days). It is possible to give some pointers, but without the U in UX you may left with bad X. Would really help if you specify some use cases: "As a user I'd like to do X, so to achieve Y". Dec 2, 2020 at 0:57
• You should probably do a paper napkin type of sketch just to help clarify the design more in your head. It will also help the community contribute suggestions and ideas based on your line of thought/reasoning. Dec 2, 2020 at 1:30
• The app I’m creating is meant to rename images having EXIF data like DateTimeTaken to the date and time they were captured, such as “2020-12-02 12.34.56.JPG”. In the case where I’ve forgotten to set my camera for DST, I can add or subtract an hour. I also have images where the EXIF date is years away from when the photo was taken so I could get reasonably close by adding or subtracting the appropriate units. After thinking about it, the part about adding 237 days is not relevant to my query, so I have removed it from the original question. I hope this clarifies my question more.
– Dave
Dec 3, 2020 at 2:27
• Perhaps the best approach here is to use all positive values and just include a "Subtract Time" checkbox if I want to create a date in the past.
– Dave
Dec 3, 2020 at 2:30

Is it more intuitive for the user to input the new time, as opposed to the time difference, especially if you are considering allowing the user to both add and subtract within the same input?

RE: time difference, Before entering the time difference, I would allow the user to pick "+" or "-" as I believe adding and subtracting different units in the same calculation would be confusing.

Also, I would not overwrite existing data.

• I like the idea of a user selecting a new date outright instead of a time difference. Still, I can't do a constant time value as there may be files having the same date but the times will always be different. I'm going to implement it as numeric edits where the values are all positive, ranges can be checked, and a checkbox is available to subtract time. I'm not about to create new 75 MB files with adjusted date/time stamps, so the existing data in the original file will be overwritten. No one creates a new Word doc when they edit it—they just overwrite each time. Thanks for the input.
– Dave
Dec 6, 2020 at 18:40
• My intent was if the original data was a time stamp or other data captured by a device, don't overwrite it but add a new column in the database for all future modifications to the date and time which can be overwritten/edited. Dec 6, 2020 at 19:56
• I understand your intent, but I want to change EXIF dates as recorded in image files so there is no database, per se. There are a select few tags where this info is stored and I don't care about original values, like simply changing values when DST wasn't accounted for.
– Dave
Dec 7, 2020 at 22:58