Created
February 24, 2019 23:26
-
-
Save ingeit/d6daeff5bbaa70570504ab34b42a8966 to your computer and use it in GitHub Desktop.
format time date javascript to mysql moment parse formato fecha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// esto sirve para parsear una fecha de javascript al formato de MYSQL contemplando el UTC -3 | |
import * as moment from 'moment'; | |
moment.locale('es'); | |
funcion(fecha){ | |
// | |
let aux = moment(fecha).format('YYYY-MM-DD HH:mm:ss') | |
// ahora AUX tiene el formato de fecha año-mes-dia hora:min:segundos reales, sin necesidad de andar restando o sumando | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment