Tag: date

  • OS X Mavericks: How to show the date in the menu bar

     

    This one is nice and easy – go to System Preferences -> Date & Time -> Clock and then tick “Show Date”:

     


    apple-os-x-mavericks-show-date-in-menu-bar

    A small thing, but quite useful.

  • Seagate HDD Date Codes

     

    seagate-date-codes

     

    On Seagate drives you may see a Date Code – e.g. 07466. What does it mean?

     

    Simply put, it’s in the format of YY:W:D, or YY:WW:D, where Y is year, W is week and D is day of week.

     

    The year is fairly self-explanatory; the weeks aren’t measured from January, though, they are from the start of the financial year – e.g. July 1st, and they begin on the first Saturday after that date. The days figure is how many days from the beginning of the week the drive was manufacturered; the weeks are considered to start on Saturdays and run through to Fridays!

     

    One wonders why they don’t simply put the date! In the case of the example above the drive was manufacturered on the 21st May 2007.

  • Changing or Updating the time zone in Ubuntu Server

     

    There are quite a few reasons you may find that you need to change your time zone – for example, if you’re using a pre-made image for a virtual machine you may find that the default timezone is not set to your country. You can change the time manually, though there is a quick and easy way:

     

    sudo dpkg-reconfigure tzdata

     

    This reconfigures the tzdata (timezone data) package and runs you through a series of prompts asking which country/city you live in, and updates the time accordingly.

     

    You can check the current system time with:

     

    date

     

    to verify that it worked!

  • Ubuntu: How to create a file or folder using today’s date

    This is a useful little trick to use in your scripts – particularly for things like periodic backups.

     

    For a file:

     

    touch $(date +%F)

     

    creates the file 2012-11-18

     

    For a folder, let’s add the time after the date:

     

    mkdir $(date +%F-%H:%M)

     

    creates the folder 2012-11-18-09:00

     

    We can use this in a command, like so:

     

    tar -cf $(date +%F).tar /path/to/files/

     

    This creates the tarball (archive) file 2012-11-18.tar from the files in the /path/to/files/.

     

    To see the other options, type man date or visit the Ubuntu webpage on date here.