customize date output

August 23rd, 2006 mysurface Posted in Admin, Common, date | Hits: 26199 | 1 Comment »

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.

One Response to “customize date output”

  1. [...] 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… [...]

Leave a Reply