1
$\begingroup$

I'm trying to find out how to format the __DATE__ and __TIME__ options in Marlin.

This is NOT a duplicate of (Show Build date and time in Marlin 2.0).

When compiling my firmware I have a line in my configuration.h

#define CUSTOM_MACHINE_NAME __DATE__ " " __TIME__ " Ender-3"

But on the printer it is showing

Dec 5 2022 18:25:13 Ender-3

I want the format mm/dd/yyyy hh:mm. Example "12/05/2022 18:25 Ender-3"

$\endgroup$

1 Answer 1

1
$\begingroup$

__DATE__ and __TIME__ are C++ pre-processor macros with a predefined format. I don't think that there's any way to change them at compile time.

$\endgroup$
1
  • 1
    $\begingroup$ Spot on! There is a way (see this question), but that requires you to interpret the string and create your own format based on the default string. $\endgroup$
    – 0scar
    Dec 8, 2022 at 11:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .