|
|
The Time Format for logs can be changed with the Following Functions
|
|
|
|
|
|
<h3>setTimeFormat<h3>
|
|
|
|
|
|
This Function takes a DateTimeFormatter
|
|
|
```java
|
|
|
.setTimeFormat(DateTimeFormatter);
|
|
|
```
|
|
|
You can create a DateTimeFormatter by giving it a Pattern [Oracle Examples](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html) Goto the Paragraph 'Patterns for Formatting and Parsing'
|
|
|
An example of achieving a Pattern would be:
|
|
|
```java
|
|
|
DateTimeFormatter.ofPattern("dd-MM-yyyy_HH_mm_ss");
|
|
|
```
|
|
|
This would out put Day-Month-Year-Hour-Minute-Second.
|
|
|
|
|
|
<h3>useDefaultTimeFormat</h3>
|
|
|
|
|
|
This will apply the Default DateTimeFormatter:
|
|
|
```java
|
|
|
.useDefaultTimeFormat();
|
|
|
```
|
|
|
|
|
|
The Default Date Time Formatter is
|
|
|
```java
|
|
|
"dd-MM-yyyy_HH_mm_ss"
|
|
|
``` |
|
|
\ No newline at end of file |