Display a future date in terminal?

Discussion in 'macOS' started by FubsyGamr, Jan 19, 2011.

  1. FubsyGamr, Jan 19, 2011
    Last edited: Jan 19, 2011

    FubsyGamr macrumors regular

    Joined:
    Sep 20, 2010
    #1
    Hey guys;

    I am here filling out an assignment sheet for my Intro to Unix class. Luckily, because I have a Mac, I am able to run all of the terminal commands without the need to go through some other program (like Putty).

    Anywho, I'm having trouble on the very last one. The question asks us how to display the date, 100 days in the future. Our teacher told us up-front that this answer is not in the book, and that we would need to search in Google.

    After searching, I found two different answers. The problem is, neither of them actually work on my Terminal. Just to confirm, I also logged into the same terminal that the rest of my classmates have to use (using Putty to connect to my school's terminal), and they don't work there, either.

    So now, I come to you guys, hoping for some help!

    Here's what I have found. Below I put what I typed into the terminal, and the resulting error message.

    Code:
    date -d "100 day"
    Code:
    usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
                [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
    and

    Code:
    date --date='100 day'
    Code:
    date: illegal option -- -
    usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
                [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
    Thanks for any/all help!
     
  2. FubsyGamr thread starter macrumors regular

    Joined:
    Sep 20, 2010
    #2
    Posting a reply because I forgot to 'subscribe' to the thread.
     
  3. plinden macrumors 68040

    plinden

    Joined:
    Apr 8, 2004
    #3
    Code:
    man date
    (Sorry, I would actually tell how to do it, but since it's a homework assignment you should find out yourself)
     
  4. FubsyGamr thread starter macrumors regular

    Joined:
    Sep 20, 2010
    #4
    Hahaha wow do I feel dumb! Because our teacher told us it wasn't in the book, and to use Google, I never thought to check man.

    I found it there.

    Thanks!
     
  5. Dalton63841 macrumors 65816

    Dalton63841

    Joined:
    Nov 27, 2010
    Location:
    SEMO, USA
    #5
    The commands would work on linux, but not on Mac. The switches for date are somewhat different for Mac.
     

Share This Page