public static function get_user_dates($contextid, $contextlevel, $instanceid, $timestamps) {
        $params = self::validate_parameters(
            self::get_user_dates_parameters(),
            [
                'contextid' => $contextid,
                'contextlevel' => $contextlevel,
                'instanceid' => $instanceid,
                'timestamps' => $timestamps,
            ]
        );

        $context = self::get_context_from_params($params);
        self::validate_context($context);

        $formatteddates = array_map(function($timestamp) {
            return userdate($timestamp['timestamp'], $timestamp['format']);
        }, $params['timestamps']);

        return ['dates' => $formatteddates];
    }
public static function get_user_dates($contextid, $contextlevel, $instanceid, $timestamps) {
        $params = self::validate_parameters(
            self::get_user_dates_parameters(),
            [
                'contextid' => $contextid,
                'contextlevel' => $contextlevel,
                'instanceid' => $instanceid,
                'timestamps' => $timestamps,
            ]
        );

        $context = self::get_context_from_params($params);
        self::validate_context($context);

        $formatteddates = array_map(function($timestamp) {
            return userdate($timestamp['timestamp'], $timestamp['format']);
        }, $params['timestamps']);

        return ['dates' => $formatteddates];
    }
public static function get_user_dates ( $ contextid , $ contextlevel , $ instanceid , $ timestamps ) { $ params = self :: validate_parameters ( self :: get_user_dates_parameters ( ) , [ 'contextid' => $ contextid , 'contextlevel' => $ contextlevel , 'instanceid' => $ instanceid , 'timestamps' => $ timestamps , ] ) ; $ context = self :: get_context_from_params ( $ params ) ; self :: validate_context ( $ context ) ; $ formatteddates = array_map ( function ( $ timestamp ) { return userdate ( $ timestamp [ 'timestamp' ] , $ timestamp [ 'format' ] ) ; } , $ params [ 'timestamps' ] ) ; return [ 'dates' => $ formatteddates ] ; }
Format an array of timestamps.

@param int|null $contextid The contenxt id
@param string|null $contextlevel The context level
@param int|null $instanceid The instnace id for the context level
@param array $timestamps Timestamps to format
@return array
Format an array of timestamps .