#JavaScript #Reactjs #ReactNative - #Date

MDN date
MDN date

On a React Native app, we can use JS Date object to get day and current time. 
With that, you can display the right greetings, style our app's components, present different view components etc. You can then use switch statements to achieve this.

let present = new Date();
present.getDay(); // return 0: Sunday - 6: Saturday

You can also use it to set your copyright year at the footer of your website like so using React:

setCopyrightLine() {
  let present = new Date();
  let year = present.getFullYear();
    copyrightLine: `Made by Jun Goh - \u{00A9} ${year}`

MDN DateJavaScript Blog

Thank you for reading!