Question: I'm trying to do a regex\_replace in smarty, I have tied the following, yet it prints the variable name, does not return the variable value.

How do I replace with `$another`?

### Attempt

```
{$title|regex_replace:"/apple/":"{$another}"}

```

Answer: 
If they are using PHP you could try something like this:

```
$date = date_create_from_format("Y-m-d\TH:i:s.uP", "2018-06-20T06:07:00.000+03:00");
echo date_format($date,'D, d M Y H:i:s O');

```

That should give you a date like: Wed, 20 Jun 2018 06:07:00 +0300

That should work as long as the input date is always going to be of the same format.
As people suggested to me in the comments, the best solution using javascript is to use the library `moment.js`

The following code does the work I need.

```
moment("2018-06-20T06:07:00.000+03:00").format('ddd, D MMM YYYY HH:mm:ss ZZ');

```