{"id":22180655,"url":"https://github.com/jftuga/timeshift","last_synced_at":"2025-06-18T15:41:06.339Z","repository":{"id":57641377,"uuid":"164572773","full_name":"jftuga/timeshift","owner":"jftuga","description":"Shift date/time from log files or from STDIN","archived":false,"fork":false,"pushed_at":"2019-02-27T20:48:19.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T23:29:54.538Z","etag":null,"topics":["datetime","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jftuga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-08T05:50:46.000Z","updated_at":"2022-09-13T12:02:13.000Z","dependencies_parsed_at":"2022-09-05T07:41:35.827Z","dependency_job_id":null,"html_url":"https://github.com/jftuga/timeshift","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ftimeshift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ftimeshift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ftimeshift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Ftimeshift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jftuga","download_url":"https://codeload.github.com/jftuga/timeshift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245332062,"owners_count":20598097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datetime","golang"],"created_at":"2024-12-02T09:19:01.701Z","updated_at":"2025-03-24T18:46:12.145Z","avatar_url":"https://github.com/jftuga.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timeshift\nShift date/time in log files or from STDIN\n\n```\ntimeshift: Shift date/time from log files or from STDIN.\nusage: timeshift [options] [filename|or blank for STDIN]\n\n  -A\tshow all formatting aliases and then exit\n  -D\tOutput the format's start position\n  -F\tshow all formatting specifiers and then exit\n  -I string\n    \tinput alias format, see -A\n  -O string\n    \toutput alias format, see -A\n  -d int\n    \tdays, use a positive number to shift forwards, negative to shift backwards in time\n  -h int\n    \thours, use a positive number to shift forwards, negative to shift backwards in time\n  -i string\n    \tinput format, see -F\n  -m int\n    \tminutes, use a positive number to shift forwards, negative to shift backwards in time\n  -o string\n    \toutput format, see -F\n  -s int\n    \tseconds, use a positive number to shift forwards, negative to shift backwards in time\n  -v\tshow program version and then exit\n```\n\n## Examples\n\n```bash\n# shift the time forward by 4m51s\ntimeshift -i \"%Y-%m-%dT%H:%M:%S.%fZ\" -m 5 -s -9 mysql_error.log\n\n# same as above, but use an alias\n# (use -A to see all of the aliases)\ntimeshift -I mysql_error -m 5 -s -9 mysql_error.log\n\n# don't shift time, just convert to another format\ntimeshift -I mysql_error -o \"%m/%d/%y %H:%M:%S\" mysql_error.log\n\n# convert the format and also subtract 5h\ntimeshift -I mysql_error -o \"%m/%d/%y %H:%M:%S\" -h -5 mysql_error.log\n```\n\n## Windows compliation\n\n* Even though this is a Go project, it uses the [strtime](https://github.com/knz/strtime) package which relies on some C code.\n* GCC will be needed in order to compile the [strtime](https://github.com/knz/strtime) package.\n* GCC for Windows can be downloaded from here: [tdm-gcc](http://tdm-gcc.tdragon.net/)\n* I used `tdm64-gcc-5.1.0-2.exe` during development.\n* `goreleaser release -f .goreleaser-windows.yml --skip-publish` and then manually upload to releases\n\n## Supported format specifiers\n\n| Format | Description | Notes\n|--------|-------------|---------\n| `%a` | Short week day (\"mon\", \"tue\", etc) |\n| `%A` | Long week day (\"monday\", \"tuesday\", etc) |\n| `%b` | Short month name (\"jan\", \"feb\" etc) |\n| `%B` | Long month name (\"january\", \"february\" etc) |\n| `%c` | Equivalent to `%a %b %e %H:%M:%S %Y` |\n| `%C` | Century | Only reliable for years -9999 to 9999\n| `%d` | Day of month 01-31 |\n| `%D` | Equivalent to `%m/%d/%y` |\n| `%e` | Like `%d` but leading zeros are replaced by a space. |\n| `%f` | Fractional part of a second with nanosecond precision, e.g. \"`123`\" is 123ms; \"`123456`\" is 123456µs, etc. | `Strftime` always formats using 9 digits.  This can be buggy and is not recommended for use with `timeshift`.\n| `%1`, `%2`, ..., `%8` | Similar to `%f`.  Fractional part of a second with nanosecond precision | Use `%1` for one decimal of precision, `%2` for two decimals, etc.\n| `%F` | Equivalent to `%Y-%m-%d` |\n| `%h` | Equivalent to `%b` |\n| `%H` | Hours 00-23  | See also `%k`\n| `%I` | Hours 01-12  | See also `%p`, `%l`\n| `%j` | Day of year 000-366 |\n| `%k` | Hours 0-23 (padded with spaces) | See also `%H`\n| `%l` | Hours 1-12 (padded with spaces) | See also `%I`\n| `%m` | Month 01-12 |\n| `%M` | Minutes 00-59 |\n| `%n` | A newline character |\n| `%p` | AM/PM | Only valid when placed after hour-related specifiers. See also `%I`, `%l`\n| `%r` | Equivalent to `%I:%M:%S %p` |\n| `%R` | Equivalent to `%H:%M` | See also `%T`\n| `%s` | Number of seconds since 1970-01-01 00:00:00 +0000 (UTC) |\n| `%S` | Seconds 00-59 |\n| `%t` | A tab character |\n| `%T` | Equivalent to `%H:%M:%S` | See also `%R`\n| `%u` | The day of the week as a decimal, range 1 to 7, Monday being 1 | See also `%w`\n| `%U` | The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01 | See also `%W`\n| `%w` | The day of the week as a decimal, range 0 to 6, Sunday being 1 | See also `%u`\n| `%W` | The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01 | See also `%U`\n| `%x` | Equivalent to `%D` |\n| `%X` | Equivalent to `%T` |\n| `%y` | Year without a century 00-99 | Years 00-68 are 2000-2068\n| `%Y` | Year including the century |\n| `%z` | Time zone offset +/-NNNN | `Strftime` always prints `+0000`\n| `%Z` | `UTC` or `GMT` | `Strftime` always prints `UTC`\n| apache_access       | %d/%b/%Y:%H:%M:%S     | Used with `-I` and `-O`\n| apache_error        | %a %b %d %H:%M:%S.%f  | Used with `-I` and `-O`\n| debian_log          | %b %d %H:%M:%S        | Used with `-I` and `-O`\n| mysql_error         | %Y-%m-%dT%H:%M:%S.%fZ | Used with `-I` and `-O`\n| o365_exchange_trace | %d/%m/%Y %-I:%M:%S %p | Used with `-I` and `-O`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Ftimeshift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjftuga%2Ftimeshift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Ftimeshift/lists"}