Skip to content

Hultner/timestamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

timestamp

Creates a nice ISO-8601 timestamp for usage in filenames, this is a built in format in some implementations of date.

Installation

Put the script somewhere in you path, i.e. in $HOME/bin (only you) or /usr/local/bin (everyone)

sudo cp timestamp /usr/local/bin

Usage

Add timestamp to a filename on a backup

cp file.ext /mnt/backup/file.$(timestamp).ext

Create a note with the current timestamp

vi meeting-notes-$(timestamp).txt

Just show the current timestamp

timestamp

Only use the day

Sometimes you only want the day and not the full timestamp, for those cases I've added the day option which can also be invoked with -d like below

$ timestamp day
2017-11-07
$ echo notes-$(timestamp -d).txt
notes-2017-11-07.txt

About

Creates a nice ISO-8601 timestamp for usage in filenames, this is a built in format in some implementations of date.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages