Question: i'm using spring boot and my index.html is in src/main/resources/templates directory and below is the content. If i render a static content from html itself it renders but when i try to render from react component it doesn't render anything

```
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <meta charset="UTF-8"/>
    <title>ReactJS + Spring Data REST</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react-dom.min.js"></script>
      <script src="http://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
</head>
<body>
    <div id="react"></div>
    <script src="built/bundle.js"></script>
</body>
</html>

```

my react component is in src/main/js/ directory and app.js file
Below is the all the codes i have in the app.js file

```
import React from 'react';
import {render} from 'react-dom';
import RendorTest from 'components/RendorTest';
class RendorTest extends React.component{
    rendor(){
        return(
            <div><h1>Spring Boot + Rest + React.js</h1></div>
        );
    }
}
var element = <RendorTest />;
ReactDOM.render(
        element,document.getElementById('react')
    )

```

Answer: 
Well, for all time-related operations, PHP expects you to set a `default` timezone (otherwise warnings are given). However, I think you're simply looking for a formatting operation.

```
<?php
date_default_timezone_set("UTC");
$source = "Mon Apr 03 00:50:15 CST 2017";
$dateOb = new DateTime($source);
print_r($dateOb);
echo $dateOb->format("Y-m-d H:i:s");

```

Output:

```
DateTime Object
(
    [date] => 2017-04-03 00:50:15.000000
    [timezone_type] => 2
    [timezone] => CST
)
2017-04-03 00:50:15

```
you can use `date_format` if you only want to format your date.

```
$date=date_create("Mon Apr 03 00:50:15 CST 2017");
echo date_format($date,"Y-m-d H:i:s");

```