How to Get Time Start of the Day Moment Js in React Native?

Jan 25, 2023 . Admin

This post will give you example of using moment js in react native. you will learn get start time of the day in react native. I explained simply about how to get start of day and start of day in moment js. you can understand a concept of react native get current date time. So, let's follow few step to create example of how to get time start of the day moment js in react native.

In this example, we will get time start of the day moment js in react can easy and simply get time start of day in react native.below this example

Step 1: Download Project

In the first step run the following command to create a project.

expo init ExampleApp
Step 2: App.js

In this step, You will open the App.js file and put the code.

import React,{useState} from 'react';
import { StyleSheet, Text, View} from 'react-native';
import moment from 'moment'

export default function App() {
    return (
      <View style={styles.container}>
        <Text style={}>{moment().startOf('day').fromNow() }</Text>

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',

  text: {
    fontSize: 24,

  date: {
    fontSize: 24,
    fontWeight: 'bold',
    padding: 15

Step 3: Run Project

In the last step run your project using the below command.

expo start

You can QR code scan in Expo Go Application on mobile.


It will help you...

#React Native