From b2f7330850e3515e56bca81a3d8d6dfb233aaa99 Mon Sep 17 00:00:00 2001 From: Bob Swift Date: Fri, 13 Mar 2020 11:29:45 -0600 Subject: [PATCH] Add platform-specific note to $datetime --- picard/script.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/picard/script.py b/picard/script.py index 540968b93..3bb6cd00f 100644 --- a/picard/script.py +++ b/picard/script.py @@ -1724,7 +1724,12 @@ def func_slice(parser, multi, start_index, end_index, separator=MULTI_VALUED_JOI Returns the current date and time in the specified `format`, which is based on the standard Python `strftime` [format codes](https://strftime.org/). If no `format` is specified the date/time will be returned in the form - `2020-02-05 14:26:32`.""" + `2020-02-05 14:26:32`. +Note: Platform-specific formatting codes should be avoided to help ensure the + portability of scripts across the different platforms. These codes include: + remove zero-padding (e.g. `%-d` and `%-m` on Linux or macOS, and their + equivalent `%#d` and `%#m` on Windows); element length specifiers (e.g. + `%3Y`); and hanging '%' at the end of the format string.""" )) def func_datetime(parser, format=None): """Return the current date and time as a string.