On 24/03/2024 18:32, wrotycz wrote:
I noticed there are no examples of how to set date using date, in the manual. Therefore I propose to add these to examples section to make it clear and easy to do so. I used simple formats, more like 'machine formats' to make it even simpler, as no one wants to use elaborate formats like 'Thu Mar 3 23:05:25 2005' only to make wrong. And one of the reasons for it is American habit to make things complicated, to put month before day, and stuff like that. That's what I propose: ---- Set new data and time: date --set "2001-02-03 11:12:13" Set new date: date +%Y%m%d -s "20010203" Set time: date +%T -s "11:12:13" Regards Wrotycz
I think one example (the first) would be enough in the manual. Note we do give more details in the full documentation (liked from the man page): https://www.gnu.org/software/coreutils/manual/html_node/Setting-the-time.html cheers, Pádraig