codepedia.de
HTML
CSS
Javascript
  • Javascript
  • JS for Web
  • JQuery
  • Async JS
Backend
  • Basics
  • Node
  • Express
  • Connect DB to Node
GIT
Databases
  • Basics
  • SQL
  • No SQL
Vue
  • Vue
  • Vue Router
  • Vue-State-Management
  • Vite
  • Quasar
  • Nuxt
  • Vue Animation
  • VuePress (opens new window)
Misc.
  • Command Line
  • VS Code
  • Jetbrains IntelliJ
  • Markdown
  • Design
  • Performance
  • Clean Code
  • Fake API
  • SSH
About/Imprint
HTML
CSS
Javascript
  • Javascript
  • JS for Web
  • JQuery
  • Async JS
Backend
  • Basics
  • Node
  • Express
  • Connect DB to Node
GIT
Databases
  • Basics
  • SQL
  • No SQL
Vue
  • Vue
  • Vue Router
  • Vue-State-Management
  • Vite
  • Quasar
  • Nuxt
  • Vue Animation
  • VuePress (opens new window)
Misc.
  • Command Line
  • VS Code
  • Jetbrains IntelliJ
  • Markdown
  • Design
  • Performance
  • Clean Code
  • Fake API
  • SSH
About/Imprint
  • Javascript

    • JavaScript Basics
    • Variables
    • Operators
    • Numbers
    • Strings
    • Arrays
    • Conditional Statements
    • Functions
    • Loops
    • Objects
    • JS 'This'
    • Maps & Sets
    • Destructuring
    • Spread... and ...Rest
    • Modules
    • Play audio
    • Classes - JS
    • Dates
      • current date and timestamp
      • Links
    • Links & Infos

# Dates

new Date()

# current date and timestamp

const date = new Date()
  • .getDate() - date
  • date.getHours()
  • date.getTime() time(ms) since 1.1.1970
const date2= new Date("1980-02-02")

different formats

  • you can calculate date - date2

  • number of days:

    • (date - date2) / 1000 / 60 / 60 /24
      

# Links

  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date (opens new window)
  • https://momentjs.com/ (opens new window)

← Classes - JS Links & Infos →