Find a Future Date from the Shell [Terminal Tip]

29 Apr/09

Have you ever needed the exact date a certain number of days in the future? The Command-Line Fu site shows how to use the date command to calculate future (and past) dates.

Using the date command is simple—just open a terminal window on your Mac, Linux, or Windows with Cygwin desktop, use the date command with the -d parameter, and pass in a number of date increments in the future in days, minutes, years, months, or even weeks. For instance, to find the date 3 weeks in the future, use the following command from the shell prompt:

date -d "3 weeks"

To find the date from a period of time in the past, you would add “ago” to the end of the command:

date -d "3 weeks ago"

You can even combine the arguments together—so if you wanted to find the exact date for 3 weeks and 2 days in the future, you would use:

date -d "3 weeks 2 days"

It’s a very simple tip, but for those of us that have a terminal window open at all times, it can really come in handy. For more geeky terminal tips, check out how to display a list of just the subdirectories, turn any Linux directory into an ISO file, or take a look through our top 10 command-line tools.

Date shows dates at other times/dates [Command-Line Fu]

Continua a leggere – Original Link: Find a Future Date from the Shell [Terminal Tip]

Technorati Tags: , , , , , , , , , , ,

Realizzazione Sito Gestionale Immobiliare

Leggi Anche

Condividi in DeliciousCondividi in DiggCondividi in RedditCondividi in StumbleCondividi in MixxCondividi in TecnoratiCondividi in Ok Notizie


I commenti sono disabilitati per questo articolo.

I commenti sono chiusi.



Iscrizione Newsletter

    Tieniti informato con tutte le novità del mondo informatico con la nostra newsletter


    Auto Shop Italia
    Web Burning Blog
    Info Privacy