odoo-13.0/addons/web/static/src/js/fields/field_utils.js
/**
 * Returns a string representing a datetime.  If the value is false, then we
 * return an empty string.  Note that this is dependant on the localization
 * settings
 *
 * @params {Moment|false}
 * @param {Object} [field]
 *        a description of the field (note: this parameter is ignored)
 * @param {Object} [options] additional options
 * @param {boolean} [options.timezone=true] use the user timezone when formating the
 *        date
 * @returns {string}
 */
Returns a string representing a datetime.  If the value is false, then we
return an empty string.  Note that this is dependant on the localization
settings


Returns a string representing a datetime . If the value is false then we return an empty string . Note that this is dependant on the localization settings
function formatDateTime(value, field, options) {
    if (value === false) {
        return "";
    }
    if (!options || !('timezone' in options) || options.timezone) {
        value = value.clone().add(session.getTZOffset(value), 'minutes');
    }
    return value.format(time.getLangDatetimeFormat());
}
function formatDateTime ( value , field , options ) { if ( value === false ) { return "" ; } if ( ! options || ! ( 'timezone' in options ) || options . timezone ) { value = value . clone ( ) . add ( session . getTZOffset ( value ) , 'minutes' ) ; } return value . format ( time . getLangDatetimeFormat ( ) ) ; }
Returns a string representing a datetime.
Returns a string representing a datetime .