Setting Date and Time via Context Menu

Hi all,

I'm looking for a way to set the modified date of a file via the context menu, without the relatively complex "Change attributes & times" dialogue.

I have created a submenu for all files with 4 entries:

  1. Touch
    This is easy:
    SetAttr MODIFIED=now

  2. Manual
    Setting the date to any given value is easy, too. With
    SetAttr MODIFIED={dlgstring|Enter Date (YYYYMMDD)|{date|yyyyMMdd}}
    I am asked to type in the date. However, the time is always set to 00:00:00. I couldn't find any information on how to format my input including the time - and trial and error so far only produced the latter... :frowning: Is there a way to set the time? Or to at least leave it unchanged?

  3. Yesterday
    and

  4. 1 Day older
    I guess these are unusual: I want to either make the file 1 day old or 1 day older, relative to its original date - both without changing the time. Is that possible at all?

Thanks in advance!
MartO

As far as I can tell, this is not currently possible in Opus alone. On page 189 of the Opus 8 pdf manual it states this about the SETATTR MODIFIED raw command: "You can specify the value now which means the current time and date, or you can specify a specific date only. The date specified must be in the form YYYYMMDD"

Also your third request seems to be outside of what Opus can currently do as well. If I wanted to do this, I'd use an external script to accomplish it. For example if you have the 4NT command processor installed the below Opus button command would set the last modified date and time of the files selected in Opus to 2:32 pm on November 30, 2005.

4nt touch /F /Dw2005-11-30 /Tw14:32 {f} & exit

Likewise, the following Opus/4NT button script would change the last modified date of the selected files backwards one day and set the last modified time to the current time.

4nt touch /F /Dw%@makedate[%@dec[%@DATE[%@filedate[{f},4]]],4] {f} & exit

As you can see, there can be a fair amount of work required to do this even with an external script. Which very well may be at least part of the reason why it's apparently not currently possible in Opus.

Thank you, John, for your answer!

Yes, I saw that, but it seemed unlikely to me (still does) that changing the date has been implemented, while changing the time hasn't. But I guess if it's in the manual I should just believe it... :wink:
I wonder what the reasoning behind resetting the time to 00:00 is, though.

I'm not using 4NT (yet), so I can't use your buttons "out of the box". I am, however, playing around with C# and writing a small utility to apply modifications to time and date which I will combine with DOpus buttons.

I'd have to disagree with that. I'm sure there are other reasons but the date/time operations themselves should be easy enough. I guess what makes the 4NT command lines so relatively complicated is the fact that 4NT is such a versatile tool which needs a lot of switches. A dedicated tool written for my specific needs is bound to be a lot simpler to use. Of course, the more options are added to DOpus, the more complicated it becomes, too. On the other hand, adding something like SETATTR MODIFIED=YYYYMMDD-HHMMSS seems only logical. After all, configurability is what DOpus is all about... I think I'll make this a feature request.

Thanks again,
MartO