shell date examples

The shell command lines below are examples to get the timestamp, iso date format as well as the date with hour, minute, and second.

#!/bin/bash
date +%s
date +%Y-%m-%d
date +%Y%m%d
date +%Y-%m-%d_%H:%M:%S

output

1419445952
2014-12-24
20141224
2014-12-24_13:32:32

Search within Codexpedia

Custom Search

Search the entire web

Custom Search