customize date output

August 23rd, 2006 mysurface Posted in Admin, Common, date | Hits: 26491 | 4 Comments »

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.

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

  2. I do agree with all of the concepts you have presented
    to your post. They’re really convincing and will certainly work.
    Nonetheless, the posts are too short for starters.
    May you please prolong them a little from next time?
    Thank you for the post.

  3. Great post.

  4. Microsoft office 2010 is a innovative editio that will please you with its interface and functionality.
    I highly recommend you to make yourself habit of checking
    your hardware manufacturer web site regularly, if possible every month.
    This is a very serious laptop for those that need the very best.

    my weblog cli.gs

Leave a Reply