Skip to content

Commit b11507b

Browse files
committed
update readme
1 parent 9cbdd78 commit b11507b

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
11
# chronox
2-
A simple Rust utility to convert log files to UTC 🦀
2+
A simple Rust utility to convert log files from local time to UTC 🦀.
3+
4+
5+
It takes dates in `Month Day HH:MM:SS` format and converts it to `YYYY-MM-DD HH:MM:SS Z` format.
6+
7+
For example using a -06:00 offset:
8+
9+
```
10+
Aug 27 00:00:00 host systemd[1]: Reloaded httpd.service - The Apache HTTP Server.
11+
```
12+
13+
Gets converted to:
14+
```
15+
2023-08-27 06:00:00 UTC host systemd[1]: Reloaded httpd.service - The Apache HTTP Server.
16+
```
17+
18+
# Usage
19+
`chronox` can be used from the command line with the following syntax:
20+
21+
```bash
22+
chronox [logfile] [timezone offset]
23+
```
24+
25+
The timezone offset needs to be in `-+00:00` format.
26+
27+
A file with the suffix `-chronox` will be saved in the same directory as the original file.
28+
29+
# Downloading
30+
31+
Grab one of the binaries from the [releases page]().
32+
33+
# Gotchas
34+
35+
* The utility assumes the year is current year.
36+
* Only files that use `Month Day HH:MM:SS` format would work (Like `messages` or `syslog`).

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ fn get_time_utc(date_str: String) -> DateTime<Utc> {
2424
}
2525

2626
fn print_usage() {
27-
println!("Usage: <filename> <timezone offset in +-06:00 format>");
28-
println!("Converts log time entries to UTC time");
27+
println!("Usage: ./chronox <filename> <timezone offset in +-06:00 format>");
28+
println!("Converts log time entries to UTC");
2929
println!("Example: ./chronox messages -06:00");
3030
}
3131

0 commit comments

Comments
 (0)