functions/index.js
//function to convert date to string
function to convert date to string
function to convert date to string
function dateToString(date) {
	if (!date) {
		return null
	}
	var dateString = date.getFullYear() + "-";
	dateString += toDoubleDigit(date.getMonth() + 1) + "-";
	dateString += date.getDate() + " " + date.toLocaleTimeString('en-US', { timeZone: 'GMT' });
	return dateString;
}
function dateToString ( date ) { if ( ! date ) { return null } var dateString = date . getFullYear ( ) + "-" ; dateString += toDoubleDigit ( date . getMonth ( ) + 1 ) + "-" ; dateString += date . getDate ( ) + " " + date . toLocaleTimeString ( 'en-US' , { timeZone : 'GMT' } ) ; return dateString ; }
function to convert date to string
function to convert date to string