Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
Format Laravel Timestamps in Front End with Javascript

I want to format the Laravel date format generated by timestamps, but I want to do that in the front end with Javascript, the time value is something like this 2022-01-03T19:16:16.000000Z, so what I want to do is to format it to something like this: 02 Jan 2021

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Here's a previous post on how you can accomplish this: How to handle datetime between php (Laravel api) and javascript (AngularJS)

However, it's worth noting that Laravel handles this for you. See documentation on Date Casting.

/**
 * The attributes that should be cast.
 *
 * @var array
 */
protected $casts = [
    'created_at' => 'datetime:Y-m-d',
];

As the post suggests you can use momentjs:

correctTime = moment('<YOUR_UTC_TIME_STRING>').format();
about 4 years ago · Juan Pablo Isaza Denunciar

0

You don't need to format it in your frontend, you can use carbon to accomplish that task in your laravel backend, it is simple and straight forward

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda