https://github.com/voidint/date2unix
Converts the date string to UNIX timestamp command-line tool.
https://github.com/voidint/date2unix
Last synced: 11 months ago
JSON representation
Converts the date string to UNIX timestamp command-line tool.
- Host: GitHub
- URL: https://github.com/voidint/date2unix
- Owner: voidint
- License: apache-2.0
- Created: 2016-05-09T02:30:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-18T13:31:08.000Z (about 9 years ago)
- Last Synced: 2025-02-01T11:12:52.557Z (about 1 year ago)
- Language: Go
- Size: 22.5 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# date2unix
Convert date string to UNIX timestamp.
# Installation
```
go get -u github.com/voidint/date2unix
```
# How to use?
- Output current time UNIX timestamp at system time zone.
```
$ date2unix --now
1462761855
```
- Output the specified time UNIX timestamp at UTC time zone.
```
$ date2unix --layout "2006-1-2 15:04:05" -p --utc "2016-10-10 01:01:01"
2016-10-10 01:01:01 => 1476061261
```
- Read date string form stdin
```
$ echo "2016/10/10 01:01:01" | date2unix
1476032461
or
$ date2unix
2016/10/10 01:01:01
// Enter EOF by CTRL+D(Unix/Linux) or CTRL+Z(Win)
1476032461
```