Dummy Variables

How to create binary or dummy variables based on dates or the values of other variables.