date
If you want to send us your comments, please do so. Thanks
More on comments
Date
Set or show the date
See also Time shifting issues and how to set the hardware clock
strftime(3) - Linux manual page
Command | Function |
---|---|
date +%d | Display the current day number e.g 21 |
date --date="100 days" | Shows the date 100 days in the future |
date --date='@2147483647' | Calculate date from epoch |
echo $(date +\%Y\%m\%d\%H\%M) | Show the formatted date |
date '+%s' -d '2011-11-04' | Calculate the seconds between 1 January 1970 and 4 November 2011, epoch |
date '+%s' --date="now" | Calcualte the date of now in epoch |
date '+%s%N' | Calcualte the date of now in epoch in nanoseconds |
printf '%(%d-%m-%Y %H:%M)T\n' | 20-06-2021 16:25 (date and time of now). Check strftime(3) for possible options. Not all options of the date command are available for printf (like %N) |
bc <<< `date '+%s' -d '2016-09-06'`-`date '+%s' -d '2016-07-01'` | Calculate the seconds between the two dates. Result: 5788800 The number of weeks is: bc «< 5788800/3600/24/7 is 9 weeks |
echo $(( (`date '+%s' -d '2018-9-4'`-`date '+%s' -d '2018-07-21'`)/3600/24 )) | 45 days |
Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy
RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.
date.txt · Last modified: 28-01-2024 21:06 by wim