News:

MultiCommander v16.6 is released!

Main Menu

Custom date format for F9 shortcut

Started by John Samuel, January 19, 2023, 21:33:00

Previous topic - Next topic

John Samuel

Hi,

I need to change the date format for creating new folder with F7->F9 shortcuts, from YYYY-MM-DD to DD-MM-YY.

In help manual it's written as "F9 - Insert todays date as YYYY-MM-DD in the folder name field"

Thanks
John Samuel

Jungle

You can create a User Defined Command of MultiScript type and bind it to a hotkey or insert it on QuickLaunch bar. The simple one could look like

@var $now = GetTime();
@var $date = FormatDate("dd-MM-yy" , $now);
@var $path = GetSourcePath() ^ $date;
MakeDir($path);


If you'd like to have different formats available.
@var $now = GetTime();
@var $options[];

arrayAdd( $options, FormatDate("dd-MM-yy" , $now) );
arrayAdd( $options, FormatDate("dd-MM-yyyy" , $now) );
arrayAdd( $options, FormatDate("yyyy_MM_dd" , $now) );
arrayAdd( $options, FormatDate("ddd MMM yyyy" , $now) );

@var $o = AskOption( "Make new dir: select date format", $options, 0 );
if( $o > -1 )
{
  @var $path = GetSourcePath() ^ $options[$o];
  MakeDir($path);
}