- [Voiceover] Let's take a look at one possible solution…to the date and time challenge.…Here we are.…As I've mentioned, it is currently June 16th,…and June 16th does appear here in the Now box.…Let's take a look at the code that I've used to get there.…So let's start at the top.…First of all,…I've renamed these variables to make them more clear.…As I'm starting to add more stuff just using C…didn't seem all that helpful.…So I've spelled it out to currentTime,…and then I've added currentDate,…and I'm just using document.getElementById to retrieve that.…
Then in the setInterval,…I've stripped out the named Update Time function,…because now we're updating the date and the time,…and just passed it in directly as an argument.…The second argument of updating every thousand milliseconds…is still down here.…So we're still grabbing a new date object every time.…But now instead of only using hours and minutes,…I'm pulling in the month and the date.…The date is easy enough.…I'm just using getDate on the date object.…That pulls in a number,…
- Working with the DOM
- Creating maps with the Google Maps API
Skill Level Beginner
2. Writing and Debugging
3. Working with Forms
4. A Matter of Time
5. Using the Google Maps API
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.