Torch Log Service
Category | Time conversion format | Description | Example |
Category | Time conversion format | Description | Example |
Century | %C | The number of centuries. It is calculated by dividing the year by 100; ranges from 00 to 99. | 01 |
Year | %Y | The number of years (centuries are included). It ranges from 0000 to 9999. For example, 2022 represents the year 2022. | 2022 |
| %y | The number of years (centuries are not included). It ranges from 00 to 99. For example, 22 represents the year 2022. | 22 |
| %G | The number of years (centuries are included). It ranges from 0000 to 9999. For example, 2022 represents the year 2022. | 2022 |
| %g | The number of years (centuries are not included). It ranges from 00 to 99. For example, 22 represents the year 2022. | 22 |
Month | %m | The number of months; ranges from 01 to 12. For example, 02 means February. | 08 |
| %B | Full month name in English. | June |
| %b | Abbreviation of month name in English. | Jan |
| %h | Abbreviation of month name in English, same as %b. | Jan |
Day | %d | The number of dates. It ranges from 01 to 31. For example, 21 represents the 21st day of the month. | 21 |
| %e | The number of dates. It ranges from 01 to 31. For example, 21 represents the 21st day of the month. Notice A space is needed before a single-digit number. | 21 |
Hour | %H | The number of hours, 24-hour format; ranges from 00 to 23. For example, 21 represents 21 o'clock. | 21 |
| %I | The number of hours, 12-hour format; ranges from 01 to 12. For example, 09 represents 9 o'clock. Note that I is the uppercase of i. | 09 |
| %P | AM or PM. | AM |
| %p | AM or PM. | AM |
Minute | %M | The number of minutes; ranges from 00 to 59. For example, 01 represents one minute. | 01 |
Second | %S | The number of seconds; ranges from 00 to 59. For example, 01 means 1 second. | 01 |
Millisecond, microsecond, nanosecond. | %f | Millisecond, microsecond, nanosecond time. Ranges from 000000000 to 999999999. For example, 1 represents 100000000 nanoseconds. Notice If the digit number is less than 9, add zeros at the end. | 100000000 |
Second-level timestamp | %s | Second-level unix timestamp; 10 digits. | 1651648193 |
Millisecond-level timestamp | %F | Millisecond-level unix timestamp; 13 digits. | 1651648192000 |
Time zone | %Z | Time zone name, such as UTC, EST, CST. | UTC |
| %z | Time zone offset in ±HHMM format or ±HH:MM format. For example, +08:00 represents UTC+8 and -0500 represents UTC-5. | -0500 |
Others | %A | Full spelling of day name in a week. | Thursday |
| %a | Abbreviation of day name in a week. | Thur |
| %j | The ordinal number of days in a year; ranges from 001 to 366. | 340 |
| %% | The % character. | % |
Timestamp | Time conversion format |
Timestamp | Time conversion format |
[2022-05-04 15:12:12.012] | [%Y-%m-%d %H:%M:%S.%f] |
2019-10-12T07:20:50.52+07:00 | %Y-%m-%dT%H:%M:%S.%f%z |
2019-10-12T07:20:50.52+07:00 | %Y-%m-%dT%H:%M:%S.%f |
1651648409 | %s |
1651648416882 | %F |