new date typescript code example Example 1: typescript current date/time let dateTime = new Date() Example 2: types date typescript const date: Date = new Date();