Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

get current timestamp shell

// If you want to get unix timestamp, then you need to use:
timestamp=$(date +%s)
Comment

bash get timestamp

# put current date as yyyy-mm-dd in $date
# -1 -> explicit current date, bash >=4.3 defaults to current time if not provided
# -2 -> start time for shell
printf -v date '%(%Y-%m-%d)T
' -1 

# put current date as yyyy-mm-dd HH:MM:SS in $date
printf -v date '%(%Y-%m-%d %H:%M:%S)T
' -1 

# to print directly remove -v flag, as such:
printf '%(%Y-%m-%d)T
' -1
# -> current date printed to terminal
Comment

bash get timestamp

timestamp=`date "+%s"`
Comment

PREVIOUS NEXT
Code Example
Shell :: install opencv2 homebrew 
Shell :: grep docker logs 
Shell :: pip install tensorflow not working 
Shell :: display docker networks 
Shell :: install maven on linux 
Shell :: bash counter 
Shell :: install traceroute ubuntu 18.04 
Shell :: npm install redux form 
Shell :: chocolatey terraform install 
Shell :: purge apache 2 
Shell :: debian show installed packages 
Shell :: remove stash files git 
Shell :: ubuntu 21.04 mingw download 
Shell :: install tkinter python 3 
Shell :: upgrade nltk version 
Shell :: get kubernetes join command 
Shell :: install webmin ubuntu 
Shell :: how to open epub files on linux 
Shell :: download vlc for ubuntu 
Shell :: how to install ghostscript on linux 
Shell :: git cambiar pull https por ssh 
Shell :: linux see battery state 
Shell :: pkgAcquire::Run (13: Permission denied) 
Shell :: bash script remove first element of array and shift index 
Shell :: how to search file name in linux using wildcard 
Shell :: check status smb linux 
Shell :: pyinstaller icon image 
Shell :: bash read a file line by line 
Shell :: download vs code in linux 
Shell :: create tar 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =