Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

482
Visualizações
Php how to convert a date time string in French back to its equivalent in English UTC

I have this date time string vendredi 11 février 2022 à 20:19:56 heure normale d’Europe centrale stored in my database.

Now I'm trying to convert it back to its equivalent in English UTC date time.

In order to process it, I tried strtotime:

$datetime = 'vendredi 11 février 2022 à 20:19:56 heure normale d’Europe centrale';

$tsparis = strtotime($datetime . ' Europe/Paris');

var_dump($tsparis);

This shows bool(false). How can I parse this string back to a timestamp.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can use IntlDateFormatter to parse dates from strings as well as format them to strings.

In this case, passing a locale of 'fr_FR', and date and time formats of "full" should be enough:

$datetime = 'vendredi 11 février 2022 à 20:19:56 heure normale d’Europe centrale';

$parser = new IntlDateFormatter(
    'fr_FR',
    IntlDateFormatter::FULL,
    IntlDateFormatter::FULL
);
$tsparis = $parser->parse($datetime);

var_dump($tsparis);

Gives int(1644607196); see online demo

This gives you a standard Unix timestamp, which you can process using whatever you want to generate a new output.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda