customize date output
August 23rd, 2006 mysurface Posted in Admin, Common, date | Hits: 3005 |
By typing date on your terminal, it will display current date and time like:
#output
Wed Aug 23 08:00:58 MYT 2006
But the functionality of date is beyond that function, you can customize the output you want. With this function, it allows admin to use the output for filename, for certain backup files, logs , etc.
I am going to show few examples:
To show the day in number, for example wed is 3 sunday is 7
date +%u
To show the date in number, to become (month)(day)(year)
date +%m%d%Y
You can have various customize output, check out more with
man date
and then /FORMAT to see all in the list.
The example usage, you can refers to Wordpress Database backup script
This is an example of wordpress backup script, which performs daily backup wordpress database.
Live Chat!









June 22nd, 2007 at 4:02 am
[...] Download thin top conkyrc. Related Posts customize date output By typing date on your terminal, it will display current date and time like: #output Wed Aug 23 08:00:58 MYT 2006 But… [...]