"This Friday" in bash script

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-05-19T03:51:18Z Indexed on 2010/05/19 4:00 UTC
Read the original article Hit count: 333

Filed under:
|

Hi,

Is there a way to calculate a time stamp for the next coming up of a week day?

So for instance, with friday, i'd like to be able to run some code that calculates that from today Wednesday 19/05/10, the next friday will be 21/05/10 and get a time stamp from it.

I know the date command can parse a given string date according to a format, but I can't figure out how to calculate "next friday from today"

Any idea?

Cheers Ben

© Stack Overflow or respective owner

Related posts about bash

Related posts about date