Nested Conditional and Date

Wrote the nested conditional function and date function that is used in
the nested conditional.