-2

Like <?php echo date("d-m-Y", strtotime($date)); ?> but in phtml? how do I change it?

Any help will be greatly appreciated. well, thx

*edit I need to convert this value of input type text in phtml.

<input style="width:160%;" id="sp_to" type="text" class="kb-inpfield datepicker" name="sp_to" validate="isDate" value="{$specific_price_to|escape:'htmlall':'UTF-8'}" />
Henrikus Anthony
  • 154
  • 2
  • 4
  • 12

3 Answers3

0

the <?php echo date("d-m-Y", strtotime($date)); ?> command is indeed the right way to to it. Maybe you should provide a bit of your code for us to help.

Fils
  • 1
  • 3
0

If I understand well, this might work for what you want to do:

<input 
  style="width:160%;" 
  id="sp_to" 
  type="text" 
  class="kb-inpfield 
  datepicker" 
  name="sp_to" 
  validate="isDate" 
  value="<?php date("d-m-Y", strtotime($specific_price_to))?>" 
/>
DocRattie
  • 1,392
  • 2
  • 13
  • 27
Fils
  • 1
  • 3
0
<?php $specific_price_to = date("d-m-Y", strtotime($specific_price_to)); ?>

to change date format

B.Kevin
  • 250
  • 3
  • 12