Linux commands for system date and time

date

Sat Feb 20 10:18:11 EST 2016

Include milliseconds

date +%x_%H:%M:%S:%N

02/20/2016_10:19:39:130259899

Only first two digits of milliseconds

date +%x_%H:%M:%S:%N | sed ‘s/\(:[0-9][0-9]\)[0-9]*$/\1/’

02/20/2016_10:20:31:34

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s