Created
October 4, 2015 00:43
-
-
Save robertcdawson/e2d07ebefffdd0cf3a10 to your computer and use it in GitHub Desktop.
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
// exercism.io exercise | |
// This function takes a date and returns a new date set one billion seconds (or gigasecond; ~31.558 years) in the future. | |
var Gigasecond = function(birthdate) { | |
this.birthdate = birthdate; | |
}; | |
Gigasecond.prototype.date = function() { | |
var gigasecondBirthday = new Date( this.birthdate.setSeconds( this.birthdate.getSeconds() + Math.pow(10, 9) ) ); | |
var gigasecondBirthdayMidnight = gigasecondBirthday.setHours( 0, 0, 0, 0 ); | |
var getDate = new Date(gigasecondBirthdayMidnight); | |
return getDate; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment