-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0198223
commit 2f7737d
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// - La fecha de hoy | ||
const todayis = new Date(); | ||
console.log(todayis); | ||
// - La fecha de tu nacimiento | ||
const bday = new Date(1997,11,30); | ||
console.log(bday); | ||
// - Un variable que indique si hoy es más tarde (>) que la fecha de tu nacimiento | ||
const mldate = todayis.getTime() > bday.getTime(); | ||
console.log(`Es ${mldate}`); | ||
// - Una variable que contenga el día de tu nacimiento | ||
const bdayday = bday.getDate(); | ||
console.log(`El dia de mi nacimiento es: ${bdayday}`); | ||
// - Una variable que contenga el mes de tu nacimiento (recuerda que Enero es mes 0) | ||
const bdaymonth = bday.getMonth(); | ||
console.log(bdaymonth); | ||
// - Una variable que contenga el año de tu nacimiento (con 4 dígitos) | ||
const bdayyear = bday.getFullYear(); | ||
console.log(`El año de mi nacimiento es: ${bdayyear}`); |