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

CC BY-SA 4.0
2022-12-08T11:52:00.720Z
Spot on! There is a way (see [this question](https://stackoverflow.com/questions/11697820/)), but that requires you to interpret the string and create your own format based on the default string.
0scar
CC BY-SA 4.0
2022-12-08T10:25:36.457Z
2022-12-08T11:53:49.090Z
2022-12-08T11:53:49.090Z
Mick
<p>I'm trying to find out how to format the <code>__DATE__</code> and <code>__TIME__</code> options in Marlin.</p>
<p>This is NOT a duplicate of (<a href="https://3dprinting.stackexchange.com/questions/10844/show-build-date-and-time-in-marlin-2-0?newreg=652849c3d77f4bcfa4c009df0d2a9ba1">Show Build date and time in Marlin 2.0</a>).</p>
<p>When compiling my firmware I have a line in my configuration.h</p>
<p><code>#define CUSTOM_MACHINE_NAME __DATE__ &quot; &quot; __TIME__ &quot; Ender-3&quot;</code></p>
<p>But on the printer it is showing</p>
<blockquote>
<p>Dec  5 2022 18:25:13 Ender-3</p>
</blockquote>
<p>I want the format mm/dd/yyyy hh:mm. Example &quot;12/05/2022 18:25 Ender-3&quot;</p>

<creality-ender-3><marlin><firmware>
Show build date and time in Marlin 2.1 firmware?
Semperfi89
# Show build date and time in Marlin 2.1 firmware?

(Asked by: username_0 on 2022-12-06)

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](https://3dprinting.stackexchange.com/questions/10844/show-build-date-and-time-in-marlin-2-0?newreg=652849c3d77f4bcfa4c009df0d2a9ba1)).

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"

**Tags:** creality-ender-3, marlin, firmware


---

## 1 answers

### Answer by username_1 on 2022-12-08. Score: 1

`__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.

> **Comments:**
> **username_2**: Spot on! There is a way (see [this question](https://stackoverflow.com/questions/11697820/)), but that requires you to interpret the string and create your own format based on the default string.  

---

