Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
How to display current time and date in react native?
import React from 'react';
import {View, Text} from 'react-native';

const Date = () => {
  const date = new Date();

  const n = date.toDateString();

  const time = date.toLocaleTimeString();

  console.log('Date: ' + n);

  console.log('Time: ' + time);

  return (
    <View>
      <Text>{n}</Text>
      <Text>{time}</Text>
    </View>
  );
};
export default Date;

I'm getting "undefined is not a constructor ,evaluating new Date()" error and " maximum call state exceeded " error I want to display date in the format

Wed, 20 Jan 2022   9:30 PM

How to do this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You redefined the variable Date as the component has the same name. That way, you cannot access the original Date anymore. Try renaming your component.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!