Hello,
Sorry my exact following code is :
<?php
$Date_Facture = "291220";
//recup jour1 du champ varchar "Date_Facture"
$jour = substr($Date_Facture,0,2);
$jour = (int)$jour;
echo $jour;
//recup Mois1 du champ varchar "Date_Facture"
$Mois = substr($Date_Facture,2,2);
$Mois = (int)$Mois;
echo $Mois;
//recup Annee1 du champ varchar "Date_Facture"
$Annee = substr($Date_Facture,4,2);
$Annee = $century.$Annee;
$Date1 = $Mois.'/'.$jour.'/'.$Annee;
echo $Date1;
$time = strtotime($Date1);
$newformat = date('d/m/Y',$time);
echo $newformat;
$typeDate = gettype($newformat);
echo $typeDate;
?>
The result:
29
12
12/29/20
29/12/2020
string
Please can you help me to convert string format to date format in php (for having Date type intead of String type in my code above )?
I use PHPRunner 10.8
Thanks