I tried using $(date)
in my bash shell script, however I want the date in YYYY-MM-DD format. How do I get this?
相关问题
- How to get the return code of a shell script in lu
- JQ: Select when attribute value exists in a bash a
- Date with SimpleDateFormat in Java
- Invoking Mirth Connect CLI with Powershell script
- Emacs shell: save commit message
相关文章
- 使用2台跳板机的情况下如何使用scp传文件
- In IntelliJ IDEA, how can I create a key binding t
- Check if directory exists on remote machine with s
- shell中反引号 `` 赋值变量问题
- How get the time in milliseconds in FreeBSD?
- Reverse four length of letters with sed in unix
- MYSQL: How can I find 'last monday's date&
- Calculate number of working days in a month [dupli
You can do something like this:
You're looking for ISO 8601 standard date format, so if you have GNU date (or any date command more modern than 1988) just do:
$(date -I)
can be used to remove colons (:) in between
output
Here x is sample date used & then example displays both formatting of data as well as getting dates 10 mins more then current date.
You can set date as environment variable and later u can use it
or