Skip to content

Commit 517bae4

Browse files
kastnerorzfe9lix
authored andcommitted
feat: add convert epoch to human-readable date
1 parent 61bdc61 commit 517bae4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Required parameters:
4+
# @raycast.schemaVersion 1
5+
# @raycast.title Convert Human-Readable Date To Epoch
6+
# @raycast.mode silent
7+
#
8+
# Optional parameters:
9+
# @raycast.icon ⏱
10+
# @raycast.packageName Conversions
11+
# @raycast.needsConfirmation false
12+
# @raycast.argument1 {"type": "text", "placeholder": "Date"}
13+
#
14+
# Documentation:
15+
# @raycast.description Convert human-readable date to timestamp epoch.
16+
# @raycast.author Siyuan Zhang
17+
# @raycast.authorURL https://github.com/kastnerorz
18+
19+
date=${1}
20+
epoch=$(echo `date -jRuf "%F %T" "$date" "+%s"`)
21+
echo -n "$epoch" | pbcopy
22+
23+
echo "Converted $date to $epoch"

0 commit comments

Comments
 (0)