Date transformation function requested

Feature Request: Generic $dateformat() Scripting Function

Mp3tag already provides several date/time properties, including locale-dependent values like %_file_mod_datetime% and locale-independent raw values like %_file_mod_datetime_raw%.

However, there is currently no scripting function that allows formatting these values into a user-defined date/time format.

As a result, users cannot easily create locale-independent filenames, tag values or export data without relying on string manipulation or the Windows regional settings.

I would therefore like to propose a generic date formatting function:

$dateformat(<date>, <format>)

For example:

$dateformat(%_file_mod_datetime_raw%,yyyyMMdd)
→ 20260702

$dateformat(%_file_mod_datetime_raw%,yyMMdd)
→ 260702

$dateformat(%_file_mod_datetime_raw%,yyyy-MM-dd)
→ 2026-07-02

$dateformat(%_file_mod_datetime_raw%,dd.MM.yyyy)
→ 02.07.2026

$dateformat(%_file_mod_datetime_raw%,M/d/yyyy)
→ 7/2/2026

$dateformat(%_file_mod_datetime_raw%,yyyy-MM-dd HH:mm:ss)
→ 2026-07-02 14:35:18

A formatting syntax based on the familiar date format specifiers used by many programming languages would probably be the most intuitive:

yyyy
yy
MM
M
MMM
dd
d
ddd
hh
mm
ss

One of the main advantages of a generic $dateformat() function is that it would not be limited to a single placeholder. It could be used consistently with all existing and future date/time properties that provide a well-defined date/time value.

For example:

$dateformat(%_file_create_datetime_raw%,yyyyMMdd)

$dateformat(%_file_mod_datetime_raw%,yyyy-MM-dd hh:mm:ss)

This would provide a simple, locale-independent and reusable solution for all scripting scenarios involving dates and times.

The proposed function name was chosen deliberately because similar concepts already exist in many programming languages and APIs (e.g. Java's DateFormat, PHP's date_format() / DateTime::format()), making its purpose immediately recognizable to many users.

6 Likes