Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. import { format } from 'date-fns'
  2.  
  3. /**
  4. * Gives you a mysql standard formatted datetime
  5. * e.g., 2018-08-08 23:00:00
  6. */
  7. function getStandardFormattedDateTime(date: Date = new Date()) {
  8. return format(date, 'YYYY-MM-DD HH-mm-ss')
  9. }
  10.  
  11. export default getStandardFormattedDateTime
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement